CDN Helper module

Operations Incubator

Issues

Git

Git

Latest

1.0.6

Compatible with Magnolia 6.2.

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.

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

1.0.6

1.0.5

1.0.4

Bootstrap cdn policy configuration.

1.0.3

Basic cdnCachePolicy bootstrap configuration performed.

1.0.2

Minor updates.

1.0.1

Minor updates.

1.0

Initial release of the module.

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