Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
The need to cache content is very different in developing, staging or production environments. If your system relies heavily on cache for performance the system may be misconfigured or suffer from undersized servers.
With Magnolia you can cache basically every object beyond the well-known page caching. See caching arbitrary objects.
Magnolia caches content on a page level by default. This means that page is the smallest unit you can cache with the standard Cache module. The Dynamic Page Caching add-on allows you to cache fragments of a page.
Static Web resources such as CSS and JavaScript as well as aggregations of such resources are cached.
Magnolia has a separate Digital asset management module. Assets (such as images) and asset renditions served directly from Magnolia are cached by default. Assets served from external an DAM such as Cumulus DAM connector or Amazon S3 Connector module are not cached by Magnolia.
The cache policy - what should be cached and what not - is highly customizable according to your requirements.
You can define flush policies - rules when the cache must be flushed. For instance, you can make the flush procedure depend on changes on JCR repositories.
The cache module comes with a configurable GZip filter to enable Gzip compression. To serve content compressed in the GZip format is a common and widespread approach to decrease network demands. All text based files (HTML, CSS, JavaScript) are compressed by default.
Ehcache is Magnolia's default third-party low level cache implementation. See below.
Alternative third-party low level cache implementation. See below.
The Cache Browser app runs on an author instance and allows you to delete cache items on a granular level. The app deletes cached items on all the public instances, independent of your public instances setup - be it a single instance or a complex cluster.
When using Personalization (Enterprise Standard), pages that have personalized content are not cached by default. You can enable caching with Advanced Cache for Personalization (Enterprise Pro).
Dynamic page caching allows you to cache fragments of a page that also contains parts that cannot be cached. DCP uses the SiteMesh module.
Magnolia cache uses established third-party libraries for the low-level functions. Depending on your production environment, one cache implementation may fit better than another. Contact Magnolia Services to get the best cache strategy for your project and server setup.
By default Magnolia uses Ehcache. The third-party library is provided by and configured with the Magnolia Ehcache 3 module. Ehcache is a robust, proven and full-featured cache product which has made it the most widely-used Java cache. It provides off-heap storage capabilities and is fully compatible with javax.cache API (JSR-107).
Ehcache 3.x always keeps cached content on the disk as long as flushing is not proactively requested. Cached content is also retained if you must restart the system.
Memcached is a high-performance, distributed memory object caching system. Magnolia's Memcached implementation brings you the advantages of a distributed cache:
Community Edition:
Enterprise Standard:
Enterprise Pro: