CDN Helper module

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.

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>3.0.0</version>
</dependency>

Configuration

The following sections guide you on configuring the CDN Helper module.

Integration with CDN

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:

defaultPageCache class

CDN cache policy

Define a CDN cache policy by adding cdnCachePolicy in /modules/cache/config/contentCaching/defaultPageCache right after the browserCachePolicy node.

cdn cache policy

Sample configuration
'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.

CDN executor

You also need to define a CDN executor under a suitable executors action by using the class, info.magnolia.cdn.cache.executor.CDNExtraHeadersCacheExecutor.

Example

cdn executor

Changelog

Version Notes

3.0.0

Initial release for Magnolia 6.4 compatibility.

Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the CDN Helper module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules