dotCMS maintains multiple different cache regions to improve performance by enabling efficient handling of different types of data and content.
- Default Cache Configuration
- Cache Statistics
- Flushing the Cache
- Advanced Cache Methods
Default Cache Configuration
The default cache configuration depends on your version of dotCMS.
Community Edition uses a Caffeine cache for all cache regions. Community Edition does not support changing of cache parameters, and can not be configured to use a disk cache or a cache service such as Redis.
For more information on how to configure cache parameters in Community Edition, please see the Caffeine Cache Provider documentation.
By default, dotCMS Enterprise is configured to use:
- A Caffeine memory-only cache for most cache regions
- Certain specific cache regions are configured to use a two-layer cache that combines both:
In the dotCMS Enterprise version you may modify the cache chains, add new cache providers, configure custom cache chains, and specify different cache chains for different cache regions.
For more information on how to configure cache parameters in dotCMS Enterprise Edition, please see the Cache Chaining documentation.
The cache statistics display information about the configuration and usage of your cache. To display cache statistics, open the Cache tab in System -> Maintenance.
The table in the Cache Stats section of the page displays the information related to the memory allocated and in use by the whole cache:
|Total Memory Available||29.6 G|
|Memory Allocated||7.6 G|
|Filled Memory||4.1 G|
|Free Memory||3.5 G|
To get information on individual cache regions, click the Refresh Stats button.
The tab displays a list of each cache region and its performance statistics:
|Region||The name of the cache region|
|Configured||Number of objects that can be stored in the region|
|In Memory||Number of object sthat are currently stored in memory in the region|
|On Disk||Number of objects that are currently stored on disk in the region|
|Load||Number of times a cache lookup has been done to load a new value|
|Hit Rate||Ratio of cache requests which were hits|
|Avg. Load Time||Average load time from the region|
|Evictions||Number of cache objects that have been evicted to make room for new items|
If you check Calculate Memory Usage and click on Refresh Stats, you will also see the Size (total) and Average Object Size for each cache region.
Flushing the Cache
You may manually flush the cache to force dotCMS to re-populate the cache from the database. When you flush the cache, you can choose to flush All Caches, or to select a single cache region to flush. The following table explains what type of object and/or content is stored in each of the cache regions you may choose from.
|Cache Region||Type of Objects or Content it Contains|
|ApiTokenCache||JWT Api Tokens|
|Apps||Configuration for Apps (YAML)|
|Block Directive||Block Cache contents|
|Block Page||Page delivery information (user, language, version, etc.)|
|Container||Containers (both standard Containers and file-based Containers)|
|Contentlet||Content items (including both properties and metadata)|
|ESQueryCache||Elasticsearch queries (including both query strings and results)|
|Host Variables||Site Variables|
|Identifier||Identifiers, inodes, and Version Info for all content|
|Indices||Elasticsearch Index configuration (not the contents of the indexes)|
|Key/Value Cache||Key/Value fields (maps keys to their associated values)|
|Layout||Page Layouts (how Containers are laid out within each Page)|
|Legacy Content Type||Legacy Content Types (structures)|
|LogMapper||Log Mappers associated with the Visitor, Activity, Admin, Push Publishing, and Security log files.|
|MultiTree Cache||Information about which content items exist in each Container in a Page|
|Navigation Tool||Navigation information (used to build menus, crumbtrails, etc. with the navtool)|
|New Content Type Cache||Content Types|
|Page||Page Properties (not the generated HTML)|
|Plugin||Static plugins (the OSGI framework handles caching of dynamic plugins)|
|PortletCache||Portlets (e.g. Tools in the Roles & Tools configuration)|
|Processed CSS Cache||Pre-processed CSS (e.g. SASS output)|
|PublishingEndPoint Cache||Push Publishing Endpoints|
|PushedAssets Cache||Assets that have been Push Published|
|Relationship||Relationship Fiels (not legacy Relationships)|
|TagInode||iNodes for Tags (to completely flush Tag caches, flush both this region and the |
|Vanity URL Cache||Vanity URLs|
|Velocity2||Velocity code (the raw Velocity code, not the HTML or other text generated when the code is run)|
|Workflow Cache||Workflows (Schemes, Steps, Actions, etc.)|
Deprecated Cache Regions
In addition, the following cache regions are maintained in the list for backward compatibility:
|CMS Role||This is an alias for the Roles region, maintained for backward compatibility;|
Clearing this region clears the Roles region (see above)
|Navigation Tool2||No longer used; maintained for backward compatibility|
|Rules Engine - Site Visits||No longer used; maintained for backward compatibility|
|System||No longer used; maintained for backward compatibility|
|User Proxy||No longer used; maintained for backward compatibility|
|Versionable||No longer used; maintained for backward compatibility|
Advanced Cache Methods
In addition to the built-in dotCMS cache, you may also implement advanced caching methods in your Velocity code. For information please see the Tag-Based Caching (Block Cache) documentation.