Free tools Windows power users keep installed
One-click scans. No signup required.
For most production JavaScript built with a bundler, content-hash filenames are the simplest default: when the code changes, its URL changes. Query-string versions can work just as well if the browser, CDN, and origin all treat the version parameter as part of the cache key. Whichever you choose, update the HTML or manifest that points to the asset and configure freshness separately.
How the two cache-busting methods work
Cache busting means giving changed content a new URL so a cache does not reuse a response stored for the old URL. A cache key identifies which stored response to use. RFC 9111 says its minimum components are the request method and target URI (RFC 9111, section 2); CDN configuration can affect how query strings are handled.
| Method | Example | What changes | Key condition |
|---|---|---|---|
| Content-hash filename | /assets/app.8d3f….js |
The file path or name changes when the content changes. | Publish the new file and update references to it. |
| Query-string version | /assets/app.js?v=8d3f… |
The query component changes when the content changes. | Every relevant cache must include that parameter in its cache key rather than ignore or strip it. |
As MDN explains, caches distinguish resources by URL, so an updated resource with a changed URL is not reused under its old URL (MDN: HTTP caching).
Which approach should you choose?
Choose content-hash filenames for most bundled production assets
A hash in the filename makes the version visible in the path, which is part of the documented cache key for Google Cloud CDN. This is a straightforward fit when your build can generate hashed names and rewrite the HTML, manifests, and imports that refer to them. It also avoids depending on a query parameter being honored by each cache.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
The deployment must keep older hashed files available while clients may still be using older HTML or manifests that refer to them. Removing an old file too soon can leave those clients pointing at a URL that is no longer served.
Choose query-string versions when filenames need to stay fixed
A URL such as /assets/app.js?v=8d3f… can distinguish versions without changing the filename. It is useful when your serving or build setup already versions assets this way, or when fixed filenames are required. Its reliability depends on cache configuration: if a CDN ignores the version parameter, two different versions can map to the same cached object.
Rank #2
| Decision point | Content-hash filename | Query-string version |
|---|---|---|
| Build and deployment | Build must create versioned names and update references. | Build or deployment must update the parameter and all relevant layers must honor it. |
| CDN cache key | Path is part of Google Cloud CDN’s documented key; check custom cache rules and origin routing. | Check that the parameter is included, not ignored or stripped, by each relevant cache and origin. |
| Potential failure mode | Clients using old references may need older files to remain available. | Ignoring the parameter can make distinct version URLs share a cached response. |
Set freshness separately from versioning
Changing a URL tells caches that a new URL identifies a different resource; the freshness policy tells them how long they may reuse a response. For versioned files that will not change at the same URL, MDN gives Cache-Control: max-age=31536000, immutable as an example. The value 31536000 is one year in seconds and is an example directive, not a universal requirement or performance benchmark. Use an appropriate shorter freshness policy or revalidation for mutable entry documents such as HTML, so clients can learn the current asset references; the right policy depends on deployment needs (MDN: HTTP caching).
If the URL cannot change when content changes, do not treat that resource as immutable. MDN explains that no-cache allows a response to be stored but requires validation before reuse; it does not mean “do not store.” Validators such as ETag and Last-Modified let a client revalidate the stored response (MDN: HTTP caching validation).
Check CDN cache-key behavior before relying on query strings
Google Cloud CDN
Google documents the filename and path as always part of its cache key. Query strings can be included, omitted, or selectively included; for backend buckets, query-string inclusion is opt-in. Its documentation describes parameters such as ?version=VERSION and ?hash=HASH as cache-busting options when configured appropriately (Google Cloud CDN: Caching).
Cloudflare
Cloudflare documents its default cache key as including the URI with its query string. Cache-key controls can include or exclude parameters, and the “Ignore Query String” cache level causes URLs that differ only by query value to share a key. Confirm the setting in use for the relevant zone and rule (Cloudflare: Cache keys).
Rank #4
Amazon CloudFront
CloudFront cache policies can include no query strings, all query strings, selected query strings, or all except selected ones. Query strings included in the cache key are also sent to the origin, so check both cache identity and the origin behavior you need (Amazon CloudFront: Query string parameters).
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Account for service-worker precaching
A service worker can maintain its own precache revision logic in addition to browser and CDN caching. Workbox uses an already-versioned URL as its cache key. For a URL without version information, it adds a query parameter containing a build-time content revision. During service-worker installation, Workbox compares revisions; during activation, it removes entries no longer in the current precache list (Workbox: Precaching).
Quick Recap
Best Value
Implementation checklist
- Choose the version signal. Use a content hash in the filename if your build can generate names and rewrite references; use a query parameter if fixed filenames suit your setup and you can control cache-key behavior.
- Update every reference. Make sure the deployed HTML, manifests, and relevant imports point to the new asset URL. A new file alone does not make clients discover it.
- Verify the actual cache key. Check CDN rules for whether query strings are included, excluded, or selectively included. Also check origin routing and any intermediate cache in the delivery path.
- Apply freshness to each resource type. Give immutable, versioned assets a long freshness lifetime if appropriate; choose a separate policy for mutable HTML or other entry documents.
- Check the service worker. Confirm its precache list and revision behavior agree with the asset URLs your build emits.
- Plan asset retention. Keep old versioned files accessible for as long as deployed clients may still reference them.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




