Fugo logo
Digital Signage Wiki/Cache-busting
2 min read
Nov 3, 2025

Cache-busting

A technique that forces browsers and proxies to fetch the latest version of a resource (CSS, JS, images) by changing its URL or cache headers.

Cache-busting: ensure users receive updated assets

Web caches improve performance by storing static assets, but they can serve outdated files after an update. Cache-busting prevents stale resources from being used by altering resource identifiers or response headers so clients request the new version. It’s essential for avoiding layout bugs, JavaScript errors, and inconsistent user experiences after deployments.

Why cache-busting matters

When browsers or CDNs continue to serve cached CSS, JS, or images, users may see broken layouts, old features, or security flaws. Cache-busting ensures critical fixes and new functionality reach end users immediately while still allowing long-term caching for unchanged assets. It balances performance (by enabling aggressive caching) with correctness (by guaranteeing updates are delivered).

Common cache-busting techniques

  • Filename hashing (recommended): append a content hash to filenames (app.1234.css). When content changes, the filename changes, forcing fetches while enabling far-future caching for stable files.
  • Versioned paths: include a version segment in the asset path (e.g., /v2/app.css).
  • Query strings: add ?v=123 or ?hash=abc to URLs—works but some CDNs or proxies may ignore query strings for caching.
  • Cache-control headers: use short max-age or must-revalidate for assets that change frequently, but this increases requests.
  • Service workers: manage cache updates programmatically for advanced control, but requires careful update flow to avoid serving stale content. Each method has trade-offs in CDN behavior, ease of tooling, and cacheability.

Best practices and common pitfalls

Ready to prevent stale assets? Start with build-time filename hashing and configure your CDN and cache-control headers to maximize performance while guaranteeing updates reach users.