Remote teams often struggle with inconsistent caching behavior when deploying static sites. This article addresses how to correctly set Cache-Control headers for versioned assets and HTML files to ensure users receive fresh content without unnecessary revalidation requests.
Scenario: A remote team updates a static site but users see old versions
Assume a small remote engineering team maintains a documentation and marketing site built from static files. The assumed author keeps a plain-text manifest titled “Cache-Control header worksheet” with three columns: asset path, header value, and reason.
The first entry in the assumed worksheet reads homepage path, “Cache-Control: no-cache”, because the HTML shell should be revalidated on each visit. A second entry reads hashed bundle path, “Cache-Control: public, max-age=31536000, immutable”, because the filename changes with each build. A third entry reads shared font path, “Cache-Control: public, max-age=604800”, because the font changes less often than page structure.
For choosing the page header, the assumed author considers two candidates. One candidate is “no-store”, which would prevent any storage but also discard validators that speed repeat loads. The other candidate is “no-cache”, which keeps storage but requires revalidation before reuse. The author picks “no-cache” for HTML because it still lets the browser compare a version tag with the server. This is an authored example, not evidence about any existing site.
The worksheet has a notes column with two fictional records. One record reads “rules file” under asset path and “Cache-Control: no-cache” under header value, with the reason “must match current asset paths”. Another reads “campaign image” under asset path and “Cache-Control: public, max-age=86400” under header value, with the reason “short promotion, rename when replaced”. These records illustrate how the author sorts assets by whether their path changes on update.
The manifest also has a validation line naming the header version check as ”version tag” in the reason column. The author plans to compare the served header with the build output, but the example does not claim such a check has run. The central choice remains tying long lifetimes to changing filenames and short revalidation to stable paths, so an updated shell points users to new assets instead of old ones.
Implementing cache busting with versioned URLs and long max-age values
MDN describes the cache-busting pattern for static resources: include a version or hash in the URL, never modify those resources, and instead publish newer versions under new version numbers or hashes so their URLs differ. In the example, React changes from a plain filename to a numbered version, and the hero image URL gains a hash query.1
For those versioned assets, MDN shows a long max-age value of 31536000 combined with immutable, noting the content will never change. The same guidance says to use no-cache for the HTML response so the client receives a new HTML version and the updated static assets. MDN adds that immutable avoids unnecessary conditional revalidation for such static resources, and that cache-busting plus a long max-age can also include immutable.1
For the next worksheet entry, you can take the assumed draft line “asset path: /app.js — header value: max-age=300 — reason: keep fresh” and split it into a versioned path plus a long-lived value. A plausible revision reads “asset path: /static/app.7f3c2.js — header value: max-age=31536000, immutable — reason: filename changes on release.” The moved version tag now lives in the name, so the long max-age applies only to that exact file; the team can choose a different release token if the current one is too long to scan.
You might then add a companion line for the entry document that points at the versioned file. One candidate keeps the shell at “no-cache” and names the new script path in the reason column as “shell references app.7f3c2.js”; another candidate leaves the shell untouched and records the swap only once the release notes are written. Either choice stays a plan, and you can record which one you picked so the worksheet later shows why the shell and the asset carry different values.
Consider a small before-and-after note beside the same row rather than a new row, such as “before: /app.js, max-age=300” and “after: /static/app.7f3c2.js, max-age=31536000, immutable.” This keeps one release line recognizable when you revisit the worksheet, and it lets you compare whether a stale reference would surface in the shell entry rather than across the whole manifest.
Configuring no-cache for HTML entry points to force validation
For an HTML entry point such as an index page, MDN documents a specific pattern under cache busting: use no-cache on the HTML response so that the HTML itself is not reused without validation. The same page explains that the no-cache response directive permits storage but requires the response to be validated with the origin server before each reuse, even when the cache is disconnected from the origin server.1
MDN also states that no-cache does not mean "don't cache"; when the intended meaning is "don't store", the no-store directive is the documented choice. A noted limitation applies here: no-cache does not guarantee revalidation for history navigations such as Back-button use, since bfcache may restore a snapshot without revalidating, and even without bfcache the browser may still serve a cached response without revalidating.1
You can take the HTML entry-point row in your own worksheet and decide whether its current header still serves the validation goal. For the homepage row, you might write “asset path: /index.html — header value: no-cache — reason: revalidate shell on each visit.” Then read that line aloud against your deployment routine: if the header is applied only to assets and not to the entry document, the row is a candidate for revision, and a second line noting “entry document excluded from rule” can make the gap visible.
Consider drafting two candidate rows for the same page instead of committing to one. One candidate might read “no-cache — keeps validators, asks for revalidation,” while another reads “no-store — avoids storage but drops revalidation benefit.” You can annotate each with a short reason and then choose the one that matches how often the shell changes. The choice remains yours; the worksheet simply records both options and the reasoning behind your pick.
For the validation line, you might add a fictional example such as “served header: no-cache — expected: no-cache — status: pending check.” This keeps the item as a planned comparison rather than a completed test, and the notes column can hold your own reminder about where the check should happen. If a later entry changes, revisit the same row and update the reason rather than adding a parallel one.
Understanding the relationship between age, freshness, and stale states
The HTTP Caching guide from MDN states that stored responses are either fresh, meaning still valid and reusable, or stale, meaning expired. It defines age as the time elapsed since the response was generated, similar to a TTL. With a response carrying max-age=604800, the guide gives this rule: if the age is less than one week, the response is fresh; if more than one week, it is stale. A response stays usable while it remains fresh, and a shared cache can report a stored response's age through the Age header, leaving the client the difference between max-age and Age.2
You can take the assumed worksheet row for the homepage shell and add a fourth column headed “stale state,” so the age and freshness choices become visible beside the header value. For that row, the entry might read “after max-age: revalidate before reuse” and the reason could note “validators retained.” The column is your own note, not a required header setting, and you can word it however makes the tradeoff clearest to you.
For a versioned script row, you might write “age: fresh until next file change” and “stale state: old filename no longer referenced.” This keeps the relationship concrete: the file name carries the freshness decision while the header governs reuse. If you prefer, you can instead record “age: bounded by max-age” and leave the stale state as “revalidate or miss,” noting which choice fits the entry document.
You can also keep a small comparison beside the worksheet rather than inside it, contrasting “fresh: reused without asking” with “stale: validated or replaced.” Reading your existing rows against those two phrases may show which entries need a clearer reason. Revise only the rows where the stated reason no longer matches the header value, and mark any unresolved row as pending rather than settled.
Using the immutable extension to skip conditional requests
The immutable extension lets a server identify responses that will not be updated during their freshness lifetime, so a client never needs to revalidate a cached fresh resource to be certain it has not been modified. RFC 8246, which defines the extension, notes that versioned URLs are a natural fit: when a sub-resource is updated it is published under a new URL, and clients that do not know the versioned URL pattern still waste conditional requests on reloads.3
When immutable appears in a response, clients should not issue a conditional request during the response's freshness lifetime, such as on a reload, unless the user explicitly overrides it, for example with a force reload. The extension applies only during that freshness lifetime; stale responses should be revalidated as they normally would be. It takes no arguments, and requests carrying it have no effect. The RFC example is Cache-Control: max-age=31536000, immutable.3
The RFC also sets conditions for intermediaries and security. Proxies should skip conditionally revalidating fresh immutable responses unless the client signals that validation is necessary, such as with a no-cache request directive. Clients should ignore the extension for resources not in an authenticated context such as HTTPS, for force reloads, and where the stored response size is not strongly indicated, such as responses delimited by connection close.3
You can take the versioned script row in your own worksheet and extend it with a short “immutable” check, asking whether the filename changes whenever the file contents change. If the answer is yes, you might add “immutable” to the header value beside the long max-age, so returning visitors can reuse the file without a conditional request. The reason column could read “filename changes on every build, so reuse is safe.”
For the same row, you might also record a small decision note: “candidate A: max-age=31536000, no immutable” and “candidate B: max-age=31536000, immutable.” The choice between them can stay yours, but writing both helps you see what the extension adds and whether a long-lived URL still refers to an unchanged file.
Keep the HTML shell row separate and revalidated, then point it at the versioned filename. If you ever reuse a filename for new contents, leave immutable off that row and note the reason, such as “same path, contents will change.” This keeps the sheet a set of decisions rather than a set of assumptions.
Avoiding conflicting directives in Cache-Control headers
When directives conflict, the MDN reference states that in theory the most restrictive directive should be honored. It gives the example private, no-cache, no-store, max-age=0, must-revalidate as basically meaningless because the first four conflict with no-store, and treats that combination as equivalent to no-store.1
The same page warns that adding no-cache does not mean “don't cache”: no-cache allows storage but requires revalidation before reuse, so it is not the directive for preventing storage. For that goal the page names no-store, which indicates that caches of any kind, private or shared, should not store the response.1
Take your worksheet row for the HTML entry document and read its header value against the row for the versioned script it points at. If the shell revalidates on each visit while the script carries a long max-age, you can record the pairing in a notes column so the contrast is visible when someone later edits either line. A short note such as “shell: revalidate — script: long-lived, filename changes” keeps the two choices from blurring together.
You might then write two candidate values for a single row before choosing one, for example “public, max-age=600” beside “public, max-age=600, stale-while-revalidate=60”. Beside each, note what the reader gains and what gets delayed; the second candidate only makes sense if you are willing to accept a brief period of older content while a refresh runs. This is a planning exercise, not a measurement.
Consider adding a column headed “conflict check” and filling one fictional example: “asset path: /app.js — header value: max-age=300 — conflict check: shell requires revalidation, script does not — status: keep separate”. You can decide whether that note stays in the worksheet or belongs in a change description.
Frequently asked questions
What could I write in a fourth column called “stale state” for the homepage shell row?
You can take the assumed worksheet row for the homepage shell and add a fourth column headed “stale state,” so the age and freshness choices become visible beside the header value. For that row, the entry might read “after max-age: revalidate before reuse” and the reason could note “validators retained.”
How can I revise an assumed draft line into a versioned path with a long-lived header value?
For the next worksheet entry, you can take the assumed draft line “asset path: /app.js — header value: max-age=300 — reason: keep fresh” and split it into a versioned path plus a long-lived value. A plausible revision reads “asset path: /static/app.7f3c2.js — header value: max-age=31536000, immutable — reason: filename changes on release.”
What paired note could I keep beside the worksheet contrasting fresh and stale behavior?
You can also keep a small comparison beside the worksheet rather than inside it, contrasting “fresh: reused without asking” with “stale: validated or replaced.” Reading your existing rows against those two phrases may show which entries need a clearer reason.
Cache-Control header - HTTP | MDN . Retrieved 2026-11-21. ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎
HTTP caching - HTTP | MDN . Retrieved 2026-11-21. ↩︎
RFC 8246 - HTTP Immutable Responses . Retrieved 2026-11-21. ↩︎ ↩︎ ↩︎