Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
Dynamic Page Caching allows you to cache static content on an otherwise dynamic page. You can mark which areas and components are dynamic. Magnolia will cache all static content and only renders the dynamic components per request. You can also set a different time-to-live on the dynamic components.
Dynamic page caching requires modules:
Read more about configuring Dynamic page caching.
<dependency> <groupId>info.magnolia.advancedcache</groupId> <artifactId>magnolia-advanced-cache-dpc</artifactId> <version>1.9.1</version> </dependency>
Shut down Magnolia, remove
WEB-INF/lib and start up Magnolia again.
The module brings
info.magnolia.module.advancedcache.rendering.DynamicFragmentDefinition. If you want to mark an area/component as a dynamic one, just add it to its template definition:
Apart from the
dynamic property you can set also time to live (
ttl) in seconds. The zero means that this component can't be cached.
mechanism is a tool such as SiteMesh which inserts dynamic content into a dynamic page. This mechanism will replace injection tags created by Fragment Injection Listener with fresh content of dynamic components.
info.magnolia.module.advancedcache.rendering.FragmentInjectionListener is a rendering listener which surrounds all dynamic areas/components with injection tags. Rendering listeners are configured under
Configurable fields in
|Field||Description||Available values||Default value|
|A text to be injected before dynamic components. Occurrences of ||any string||-|
|A text to be injected after dynamic components. Occurrences of ||any string||-|
|The URI format of dynamic components.|
|Skip rendering of dynamic components if true, otherwise renders current content of the component. Rendering of current content of dynamic components (which will be stored in cache and can be obsolete later) could be useful as fallback if fresh content of this component can't be retrieved because of an error.||true, false||false|
The main goal of dynamic page caching is improving of performance thanks to the ability of caching pages with a dynamic content. Here are few points to remember: