Web HTTP - Cache Bursting (Content fingerprinting)
About
A cache-buster makes the URL unique each time the content is new and the content will therefore not be in the cache.
Because the cache key of the resources contains the URI, the HTTP cache mechanism (of the browser, proxy,…) will have then a cache miss and will be then forced to fetch the resources again.
The cache-buster can take the form of
- a unique query string used uniquely to form a unique URL
- or an unique location path:
- with the version in the path or in the name of the file
- or with http rewrite
Articles Related
Syntax
my.js?ver=3.0.1
<!-- or -->
my-3.0.1.js <!-- with http rewrite rule to redirect to the file my.js -->
Implementation
- Manually add a cache buster when the file has changed
- Automatically compute it for instance to Hash or Date Time value.