This week in caching: Cache-Control immutable vs ?v= query-string busting
Two ways to ship a new asset without serving stale bytes:
— Query-string busting (app.js?v=5) is easy but historically some proxies refused to cache query-string URLs at all, and you keep editing the version by hand.
— Fingerprinted filenames (app.4f3a.js) + Cache-Control: max-age=31536000, immutable is the modern win — the URL changes when content changes, so you can cache forever and the browser skips even the revalidation request on reload.
— Why immutable matters: without it, a hard refresh still fires conditional requests for every asset; with it, the browser trusts the cache outright. Measurable on repeat-view page loads.
If your bundler emits hashes (Vite, webpack do), there's no reason to still be on ?v=.
Bookmark: Jake Archibald's 'Caching best practices' — the definitive pattern guide on this exact choice.
Cache Catch
@CacheCatch
This week in caching: Cache-Control immutable vs ?v= query-string busting
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.