The Timed Memory cache provider implements a local memory-only cache for dotCMS which automatically evicts items from the cache after a configured time out 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 time out to the Guava memory-only. The Timed Memory cache provider is included with dotCMS, but may only be enabled and configured by customers with an Enterprise license.
The following parameters in the dotmarketing-config.properties control the bahavior of the Timed Memory cache.
- It is strongly recommended that you make all changes to the dotmarketing-config.properties file through a ROOT folder plugin.
- 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 Time Out Properties
The time out used for each cache region is configured via properties of the following form:
- The 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.
- The TIMEOUT is specified in seconds.
Default Time Out
The cache.default.seconds property specifies the default time out. This time out will be used for any cache region which does not have its own time out property.
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 H2 Cache, you could change the default chain as follows:
For more information on how to configure cache regions to use the Timed Cache provider, see the Cache Chaining documentation.