jargon

Comparison

Cache bustingvsImmutable caching

Cache busting

you deployed a fix and users kept getting the old file until you changed its name.

Forcing a fetch of a changed asset by changing the URL it lives at, rather than trying to persuade caches to expire. Query strings were the old approach and are unreliable in intermediate caches; a content hash in the filename is the current one. Anything served without a hash — the HTML entry point, a service worker script — needs a short cache lifetime instead, because that is the only lever left.

Full entry →

Immutable caching

the JavaScript is cached for a year because its name guarantees the contents can never change.

Serving hashed assets with a very long max-age and the `immutable` directive, so the browser does not even revalidate them. It is the payoff for content hashing and the single biggest win for repeat visits. It is also unforgiving: an unhashed file served this way is stuck in caches you do not control until the max-age expires.

Full entry →

Related comparisons