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

This documentation is a static copy for this version. For current documentation, see: http://dotcms.com/docs/latest

Guava Cache Provider

The Guava cache provider implements a local memory-only cache for dotCMS. For more information on cache providers in dotCMS, please 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, but is not enabled by default; the default Caffeine cache is an improved version of the Guava cache, and the Guava cache is only provided for backward compatibility for existing customers. Customers with an Enterprise license may change the default cache region or individual cache regions to use the Guava cache (instead of, or possibly in addition to, the default Caffeine cache provider).

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 properties extension file.

Default Properties

The following parameter configures the default cache size (number of entries) and the concurrency level of the Guava cache.

Note: The cache.default.size property is shared with the Caffeine cache. Although it is not common (or recommended) to run both the Guava cache and the Caffeine cache at the same time, it is important to recognize that changing this property will affect both cache providers, and that if you switch from Caffeine cache to Guava cache or vice-versa, the default region cache size will remain the same.

## Guava Cache Size Settings
cache.default.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.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 Guava cache is not configured for any cache regions by default.

To use the Guava cache in place of the Caffeine cache for all cache regions, you must replace com.dotmarketing.business.cache.provider.caffeine.CaffeineCache with com.dotmarketing.business.cache.provider.guava.GuavaCache in both the default cache region and all cache regions where the Caffeine cache is currently specified. For example, the following configuration settings replace the Caffeine cache with the Guava cache in the default cache chain configuration shipped with dotCMS:

cache.default.chain=com.dotmarketing.business.cache.provider.guava.GuavaCache
cache.velocitymemoryonlycache.chain=com.dotmarketing.business.cache.provider.guava.GuavaCache
cache.contentletcache.chain=com.dotmarketing.business.cache.provider.guava.GuavaCache,com.dotmarketing.business.cache.provider.h22.H22Cache
cache.velocitycache.chain=com.dotmarketing.business.cache.provider.guava.GuavaCache,com.dotmarketing.business.cache.provider.h22.H22Cache

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