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:
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.
|
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.
|
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:
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.