Skip to content
Performance & Accessibility

Asset Versioning and Cache Busting: The Decisions That Matter

Adding version identifiers to asset filenames so browsers can cache them for a long time and still get updates.

Marcus Adeyemi Technical Director 2 min read 23 views
Asset Versioning and Cache Busting: The Decisions That Matter

What is at stake

Without versioning, teams either serve stale files or lose caching entirely, and both hurt users.

The playbook

  1. Fingerprint CSS, JavaScript and images
  2. Serve versioned assets with long cache lifetimes
  3. Keep HTML cache lifetimes short
  4. Verify headers after deployment
  5. Purge CDN caches when needed

Where it goes wrong

Avoid:

  • Query-string versioning on CDNs that ignore it
  • Long cache times on HTML
  • Manual version numbers
  • Assets updated in place
What to do and what to avoid with asset versioning and cache busting, side by side
Good practice against the usual mistakes, from the sources listed below.

The numbers behind it

Published figures for Asset Versioning and Cache Busting
MeasureFigure
Fingerprintscontent hashes in filenames change when files change
Immutable cachingversioned files can be cached for a year
HTMLshould not be cached long, as it points to assets
Build toolsgenerate fingerprinted filenames automatically

Getting outside help

When to hand it over: Bring in help when users see stale assets after releases.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Performance & Accessibility work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

Marcus Adeyemi

Builds and maintains the web work. Writes about front-end architecture, performance, accessibility and the unglamorous parts of keeping a site alive.

Keep reading

More in Performance & Accessibility