CDN Helper module
Operations Incubator
Issues |
|||
Git |
|||
Latest |
1.0.6
|
The CDN Helper module provides an extension to the current browser cache policy to support the private
attribute that tells external systems like a CDN to exclude content from their cache.
This module is at the INCUBATOR level. |
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
<dependency>
<groupId>info.magnolia.cdn</groupId>
<artifactId>magnolia-cdn-helper</artifactId>
<version>1.0.6</version>
</dependency>
Configuration
The following sections guide you on configuring the CDN Helper module.
Integrating with your CDN is determined by your specific CDN type.
Update CDN cache configuration class
To use CDN extra header caching, add the class
property under /modules/cache/config/contentCaching/defaultPageCache
with the value info.magnolia.cdn.cache.CDNExtraHeaderCachingConfiguration
as shown here:
CDN cache policy
Define a CDN cache policy by adding cdnCachePolicy
in /modules/cache/config/contentCaching/defaultPageCache
right after the browserCachePolicy
node.
'cdnCachePolicy':
'class': 'info.magnolia.cdn.cache.cdncachepolicy.CDNCachePolicySet' (1)
'policies':
'default':
'class': 'info.magnolia.cdn.cache.cdncachepolicy.ExtraHeaders'
'voters':
'sampleVoter':
'class': 'info.magnolia.voting.voters.URIStartsWithVoter'
'pattern': '/example/'
'extraHeaders':
'header1': 'sampleValue'
'header2': 'sampleValue'
1 | You can config non cache policy by using the class, info.magnolia.cdn.cache.cdncachepolicy.Never . |