Test case:
<script>
console.log('request');
(new Image()).src = 'https://s3.amazonaws.com/mapbox-gl-js/tests/no-cache.png';
setInterval(function() {
console.log('request');
(new Image()).src = 'https://s3.amazonaws.com/mapbox-gl-js/tests/no-cache.png';
}, 5000);
</script>
Neither Chrome nor Firefox make any network requests for no-cache.png
beyond the first, despite it being served with Cache-Control: no-cache
, indicating that user agents must revalidate cached content.
A few questions here (e.g. this one) touch on this and provide workarounds, but I'm most interested in answering more fundamental questions:
- What web specifications, if any, permit or require this behavior?
- If it is not specified, is it at least officially documented by one or more browsers?
- What controls, if any, do web authors have over this behavior?
- In particular, is there a way to bust the cache without losing the benefits of revalidation via
If-None-Match
, as the use of a cache-busting query parameter does?