BranchCMS File CDN

Files such as images, PDFs, and CSS files can be served through a CDN powered by AWS CloudFront. 

To enable the CDN go to Settings -> CDN.

Once the CDN is enabled, any URLs for files will be updated automatically to use the CDN URL. (The only exception to this are files whose paths are relative or absolute URLs within the site's domain name. Typically only websites that were set up before the CDN was available will have URLs like this.)

Cache busting

If you update a file but the same URL is used for the file, then there are two techniques for clearing the CDN cache so that the latest version of the file is used.

Option 1 - cache buster value

The first is to add a number or string between the file name and the extension. 

For example, if your file name is main.css then you can do main.1.css to force the cache to get the latest version. The value can be any alphanumeric string.

Option 2 - URL parameter

Add a URL parameter to set the "version" for the file. The only URL parameter that will work is "v"

For example, if your file is main.css then you can add ?v=SOMETHING to the URL to tell the CDN to get the latest version like main.css?v=4.

With each change to the file, you will need to update the cache buster or URL parameter value.