I want an HTML attribute to force browsers to bypass cached assets for a page

Submitted by Fish

This idea is currently being discussed.

I want an HTML attribute — or a straightforward browser-native mechanism — that lets me instruct the browser to bypass its cache for specific linked assets when I know those assets have changed, without relying on server-controlled headers or fragile cache-busting query strings.

When I deploy updates to CSS or JavaScript in production, users who have visited the site before frequently continue to see the old, cached versions. The standard technique of appending a version or timestamp query string (e.g., style.css?v=20240415) works in theory, but in practice it can be ignored by some proxy caches, requires build-tool integration to automate reliably, and adds complexity to asset management.

Ideally, I want something like a cache-bust or no-cache attribute on <link> and <script> elements, or a declarative way within HTML to signal that a resource should be fetched fresh regardless of what the browser has stored. This would complement — not replace — existing HTTP cache headers, giving authors an in-markup escape hatch for critical updates.

A predictable, declarative approach would reduce broken deployments for users, lower the barrier for developers who do not control their server's HTTP response headers, and avoid the accidental over-caching that can leave users on broken or inconsistent versions of a web application after an update.

Tagged
HTML Api
Votes
0
What are votes for and how are they tallied?