FlexCache Configuration Options
The FlexCache is enabled or disabled in the configuration
/WEB-INF/config/opencms-system.xml of your OpenCms web application.
There are two options to set the FlexCache:
- Enable or disable the cache completely and
- enable or disable caching of resources in the offline projects (i.e. resources which are not yet published).
Here's the default configuration in
<flexcache> <cache-enabled>true</cache-enabled> <cache-offline>false</cache-offline> <maxcachebytes>8000000</maxcachebytes> <avgcachebytes>6000000</avgcachebytes> <maxentrybytes>400000</maxentrybytes> <maxkeys>2000</maxkeys> </flexcache>
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.
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.
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.
The average amount of server memory used by the FlexCache in bytes.
The maximum size of a single cache entry in bytes.
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.