Guava Cache Provider - Documentation topics on: cache properties,cache providers,cache settings,configuring the dotcms cache,guava,memory-only cache,.

Guava Cache Provider

The Guava cache provider implements a local memory-only cache for dotCMS. For more information on cache providers in dotCMS, see the Cache Properties documentation.

What is Guava?

Guava cache is a cache library that is part of the Google Guava core java libraries.

For more information about Guava and the Guava cache, please visit the Guava Official Website.

Guava in dotCMS

A Guava cache provider is included with dotCMS, and is enabled by default for all cache regions in both Community and Enterprise editions. All customers may change the Guava Configuration Properties (see below), and customers with an Enterprise license may change how the Guava cache provider is used in each cache region.

Configuration Properties

The following parameters in the dotmarketing-config.properties control the bahavior of the Guava cache.

  • Note: It is strongly recommended that you make all changes to the dotmarketing-config.properties file through a ROOT folder plugin.

Default Properties

The following parameters configure the default cache sizes (number of entries) and the concurrency level of the Guava cache.

## Guava Cache Size Settings
cache.default.size=1000
cache.livecache.size=1000
cache.workingcache.size=1000
cache.concurrencylevel=32

Where:

  • cache.default.size specifies the default cache size (number of entries), which will be used for any cache region which does not have a cache size set explicitly (see below).
  • cache.livecache.size specifies the default size (number of entries) for the cache storing live versions of pages.
  • cache.workingcache.size specifies the default size (number of entries) for the cache storing working versions of pages.
  • cache.concurrency.level specifies the Guava concurrency level.

Cache Region Sizes

In addition to the default cache settings, you can also specify the size (number of entries) of the Guava cache for each cache region, giving you the flexibility to tune the cache for the specific design of your site. The following settings are the defaults, but may be modified by editing these properties.

## Region Specific Guava cache Settings
cache.adminconfigpool.size=100
cache.blockdirectivecache.size=1000
cache.categorybykeycache.size=1000
cache.categorycache.size=1000
cache.categorychildrencache.size=1000
cache.categoryparentscache.size=1000
cache.companypool.size=10
cache.contentletcache.size=5000
cache.fileassetmetadatacache.size=200
cache.dotcmslayoutcache.size=1000
cache.dotcmsrolecache.size=1000
cache.dotcmsrolekeycache.size=1000
cache.dotcmsuserrolecache.size=1000
cache.fieldscache.size=1000
cache.filecache.size=1000
cache.foldercache.size=1000
cache.hostaliascache.size=1000
cache.hostcache.size=1000
cache.hostvariablescache.size=1000
cache.htmlpagecache.size=1000
cache.identifiercache.size=50000
cache.languagecacheimpl.size=1000
cache.navcache.size=1000
cache.parentpermissionablecache.size=10000
cache.permissioncache.size=50000
cache.plugincache.size=1000
cache.portletpool.size=100
cache.structurecache.size=500
cache.templatecache.size=500
cache.userdotcmscache.size=1000
cache.useremaildotcmscache.size=1000
cache.userproxycache.size=1000
cache.velocitycache.size=1000
cache.velocitymenucache.size=1000
cache.velocitymisscache.size=1000
cache.versioncache.size=50000
cache.versioninfocache.size=50000
cache.virtuallinkscache.size=1000
cache.workflowcache.size=1000
cache.workflowstepcache.size=1000
cache.workflowtaskcache.size=10000
cache.indiciescache.size=8
cache.publishingendpointcache.size=100
cache.workflowactioncache.size=10000
cache.logmappercache.size=10
cache.translatedquerycache.size=5000
cache.csscache.size=2500
cache.dotcmsrootrolescache.size=1000
cache.identifier404cache.size=1000
cache.fieldsvarcache.size=1000
cache.relationshipcachebyname.size=1000
cache.relationshipcachebyinode.size=1000
cache.propertycache.size=1000
cache.containercache.size=1000
cache.newnotificationcache.size=1000
cache.containerstructurecache.size=1000
cache.blockdirectivehtmlpagecache=1000
cache.pushedassetscache=5000
cache.ratingcache=1000
cache.velocityuservtlcache=500

Cache Chain Properties

The default cache chain includes the Guava cache provider by default:

cache.default.chain=com.dotmarketing.business.cache.provider.guava.GuavaCache

Therefore you only need to add the Guava cache provider to the cache chain for any new cache chain properties you create for specific cache regions. To add the Guava cache provider to the cache chain property for a region, you must add com.dotmarketing.business.cache.provider.guava.GuavaCache to the cache chain properties for the cache regions where you wish to use it. For example, the following property specifies a cache chain for the adminconfigpool cache region that uses only the Guava Cache:

cache.adminconfigpool.chain=com.dotmarketing.business.cache.provider.guava.GuavaCache

For more information on how to configure cache regions to use the Guava Cache provider, see the Cache Chaining documentation.