Static Asset Cache Buster
When static assets, such as images and PDFs, are served by the web server, they are cached by external caches (e.g. Varnish, CDN, browsers). This becomes problematic when a given asset is replaced on the web server.
For example, if https://example.com/sites/default/files/2022-annual-report.pdf is updated with a newer file with the same file name, the external caches will continue to serve the old version. This issue exists when using modules like Media Entity File Replace and Media: Acquia DAM.
This module seeks to address the issue by appending a query string to asset URLs, which acts as a cache buster. The value of the 'cb' query parameter is a hashed/truncated value from the file entity's 'changed' timestamp.
For example, 2022-annual-report.pdf becomes 2022-annual-report.pdf?cb=64227fd1. When the file is updated, the value of the 'cb' query string parameter will change.
This module doesn't provide any configuration.
Supported Uses
This module supports the following use cases:
- The 'image' and 'responsive_image' theme hooks
- This includes the 'Image' (image), 'Responsive Image' (responsive_image), and 'URL to image' (image_url) field formatters.
- Image derivative URLs also also also included.
- The 'file_link' them hook
- This includes the the 'Generic file' (file_default), 'Table of Files' (file_table), and 'URL to file' (file_url_plain) field formatters.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 1.1.0 | Stable | Aug 28, 2024 | ||
| 1.0.0 | Stable | Mar 31, 2023 | ||
| 1.0.0-beta1 | Pre-release | Jan 17, 2023 | ||
| 1.x-dev | Dev | Jan 17, 2023 |