The Timed Memory cache provider implements a local memory-only cache for dotCMS which automatically evicts items from the cache after a configured timeout period. For more information on cache providers in dotCMS, see the Cache Chaining documentation.
The Timed Memory cache provider is based on the Guava cache provider, adding a timeout to the Guava memory-only cache. The Timed Memory cache provider is included with dotCMS, but may only be enabled and configured by customers with an Enterprise license.
Configuration Properties
The following parameters in the dotmarketing-config.properties control the bahavior of the Timed Memory cache.
Note:
- It is strongly recommended that you make all changes to the dotmarketing-config.properties file through a properties file extension.
- These parameters are not included in the dotmarketing-config.properties file that ships with dotCMS.
- You must manually add these properties to your configuration when you add the Timed Cache provider to your cache chain configuration.
Cache Timeout Properties
The timeout used for each cache region is configured via properties of the following form:
cache.CACHE-REGION-NAME.seconds=TIMEOUT
Where:
- CACHE-REGION-NAME specifies the name of the cache region.
- See Cache Region Names in the Cache Chaining documentation for an explanation of how to find the property names for different cache regions.
- TIMEOUT is specified in seconds.
Default Timeout
The cache.default.seconds property specifies the default timeout. This timeout will be used for any cache region which does not have its own timeout property configured.
cache.default.seconds=100
Cache Chain Properties
For dotCMS to use the Timed Cache provider, you must add com.dotmarketing.business.cache.provider.timedcache.TimedCacheProvider
to the cache chain properties for the cache regions where you wish to use it. For example, to change the default chain to search the Timed Cache before the H22 Cache, change the default chain as follows:
cache.default.chain=com.dotmarketing.business.cache.provider.timedcache.TimedCacheProvider,com.dotmarketing.business.cache.provider.h22.H22Cache
For more information on how to configure cache regions to use the Timed Cache provider, see the Cache Chaining documentation.