FlexCache Configuration Options

The FlexCache is enabled or disabled in the configuration file /WEB-INF/config/opencms-system.xml of your OpenCms web application. There are two options to set the FlexCache:

  1. Enable or disable the cache completely and
  2. enable or disable caching of resources in the offline projects (i.e. resources which are not yet published).

Here's the default configuration in /WEB-INF/config/opencms-system.xml :

<flexcache>
	<cache-enabled>true</cache-enabled> 
	<cache-offline>false</cache-offline>
	<maxcachebytes>8000000</maxcachebytes> 
	<avgcachebytes>6000000</avgcachebytes>
	<maxentrybytes>400000</maxentrybytes> 
	<maxkeys>2000</maxkeys>
</flexcache>

Configuration nodes:

Node Description
cache-enabled

Enables or disables the FlexCache. In case you disable the FlexCache, you do not need to bother about the settings of the other Flex cache values.
The following values are possible:

true (default)
The FlexCache is enabled.
false
The FlexCache is disabled.
cache-offline

In a development environment, we recommend to set the value of the "cache-offline" node to "true" so that you can test out the caching behaviour of the application without publishing.
In a production environment you should set "cache-offline" node to "false". The following values are supported:

true
The FlexCache for offline projects is enabled.
false (default)
The FlexCache for offline projects is disabled.
maxcachebytes

The maximum amount of server memory used by the FlexCache in bytes. The amount of available server memory is the critical factor here and has to be considered carefully.

avgcachebytes

The average amount of server memory used by the FlexCache in bytes.

maxentrybytes

The maximum size of a single cache entry in bytes.

maxkeys

The maximum number of cached page variations in the FlexCache.

The default settings of the FlexCache parameters after installing OpenCms are:

  • The FlexCache is enabled
  • The cache for offline projects is disabled
  • The FlexCache uses 8mb memory for the cached pages or a maximum of 2000 cached page variations in total.

Note: The caching of offline resources is highly useful in the development process, because you can directly check how your application caching behaves after publishing. Make sure you know the FlexCache request parameters that you can easily clear the cache after you changed something in your offline project.