Reference library

Article number: 310313

Fingerprinting

Fingerprinting allows a very long cache period to be used for script and CSS files whilst still allowing you to make changes to them. It works by automatically adding a version number to the file name, which increments every time you make a change.

To enable fingerprinting for a javascript or CSS file, edit the asset, set the checkbox in the advanced properties and publish.

fingerprint props

A magic word will be shown in the advanced properties that allows you to link to the asset in your front-end code or the script manager.

<script src=":::assetfullpath.shortcutid-310322:::"/>

When fingerprinting has been enabled, the asset is automatically renamed to include a version number that increments whenever you publish a change.

By using the magic word to refer to the asset, your front-end HTML will automatically update with a new version suffix whenever you make an edit.

fingerprint vers name

Once fingerprinting is enabled for the asset, you can safely make it immutable or set a very long cache period for it. If you need to modify the asset, its name will automatically change due to the version number increasing, so the browser will see it as a completely new file.

'Immutable' tells the browser that a file will never change, so it only ever needs to fetch it once. If you were to set this on a file without using fingerprinting then the file could never be changed, as your users' browsers would continue to use the previous version forever.

Related questions