Modern consumer brand teams often manage high-traffic static sites where performance is critical. Configuring HTTP Cache-Control headers correctly ensures that users receive the latest content without unnecessary network requests. This article explores how to handle conflicting directives, implement cache busting for versioned assets, and apply specific caching rules for HTML versus static resources. We will look at practical examples of header configurations that balance freshness with efficiency, helping teams avoid common pitfalls like stale content or excessive revalidation.
Assuming a Brand Team Needs to Optimize Static Asset Delivery
Here is an imagined author: a web performance lead at a mid-sized consumer brand, working from a laptop with three open documents — a spreadsheet of asset paths, a draft page listing header rules, and a notes file of open questions. None of this comes from a real deployment; the figures and names are invented to show how the choices fit together.
The first working item is a delivery checklist with columns for asset group, example path, Cache-Control value, and review owner. Two invented rows look like this: “hero image set — /static/img/hero-spring-01.webp — public, max-age=31536000, immutable — visual lead,” and “seasonal promo banner — /static/img/promo-summer-a.webp — public, max-age=86400, must-revalidate — campaign owner.” The grouping logic is simple enough to explain to a non-specialist: versioned files that never change in place can carry long lifetimes, while banners whose paths stay stable across edits get shorter lifetimes so browsers check back.
A second item is a short instruction page titled “Header Rules for Static Files,” deliberately narrow in scope. Its first rule separates fingerprint-based names from stable names, giving one example of each. Its second rule says that any file whose content changes without a name change gets a shorter cache lifetime and a validation directive, with one invented exception noted for a small set of icons. Its third rule asks reviewers to confirm the value on a staging host before promotion, described as a step in the process rather than a completed test. The page avoids promising speed improvements; it only states what each directive instructs a cache to do.
A third item is a naming shortlist the author keeps beside the checklist: “hero-2025-spring,” “banner-summer-v2,” and “icons-solid.” The author picks the first style for large campaign imagery because the date segment makes regeneration easy to spot, and rejects “icons-solid” for anything that changes without a version bump. These are the author’s own spellings for internal housekeeping; no external upload or registration behavior is assumed.
The open questions file records the tradeoff the author is weighing: whether the seasonal banner should move to a versioned path like the hero set, giving it a long lifetime, or keep its stable path with a one-day lifetime so campaign edits take effect faster. The draft leans toward the versioned path, noting that the campaign owner would need to update one reference. That is the decision left open when the checklist is circulated for comment.
Understanding Conflicting Directives in Cache-Control Headers
When several Cache-Control directives appear together, MDN states that in theory the most restrictive directive should be honored. Its example combines private, no-cache, max-age=0 and must-revalidate with no-store, and observes that this conflicts because no-store means no cache of any kind should store the response; the line is described as equivalent to no-store alone.1
MDN also notes that several directives are permitted and must be comma-separated, and that directive names are case-insensitive, though lowercase is recommended because some implementations do not recognize uppercase. For static assets, its guidance pairs cache-busting URLs with a long max-age and immutable so that revalidation is avoided.1
You can take the invented “Header Rules for Static Files” page next and add a conflict-review note that points at one concrete pair of headers before you edit anything else. The note can say that the same asset group should not carry both a long freshness lifetime and a must-revalidate instruction, because the two place opposite expectations on how the file is reused. You might phrase it as a question for yourself: “Which directive should win for this file, and what evidence in the path tells me so?” That framing keeps the page a working record rather than a claim about how any server behaves.
Consider then testing the note against your own invented rows rather than adding new rules. If a fingerprint-based asset such as main-4f9c.js is listed with a year-long max-age, you can write on the same line that a must-revalidate flag would undercut the reason for that long lifetime, and note whether the file name itself signals a safe replacement path. For the seasonal banner, you might record the opposite: a short lifetime plus a validation check keeps the changing image in view, while a no-store value would remove reuse entirely. Add a last column for your own decision, such as “keep long lifetime, drop revalidation” or “hold for review,” so each choice is visible and reversible.
You can also keep a separate open-questions entry for each conflicting pair, naming the asset, the two directives in tension, and the person who should decide. That gives the draft page and the spreadsheet a shared reference point without turning either into an operational instruction.
Implementing Cache Busting for Versioned Static Assets
MDN describes a cache-busting pattern in which a version or hash is added to a static asset's filename or query string. The example changes a script path to include a numbered version and a picture path to include a hash query. Because the content at each resulting URL is never modified, the documentation says each asset can receive a long max-age value together with immutable — its example uses max-age=31536000, immutable. When the library or picture is updated, the new content should get a new URL, so caches are not reused. MDN also applies no-cache to the HTML response so the client revalidates it and receives the current HTML that references the new asset URLs.1
You can take your own asset spreadsheet and mark one seasonal image and one font file as the two items to version first. For each, note the current filename, the new filename you plan to use, and where links to it appear, so the change is traceable before anything is renamed. This is a preparation step you control, not a record of a completed deployment.
You might then rewrite the two filenames as examples rather than commitments. A banner currently listed as spring-sale.jpg could become spring-sale-2025-03.jpg, and a font listed as brand-sans.woff2 could become brand-sans-v2.woff2. Beside each, record in a sentence why the new name carries a version: the image is seasonal and will be replaced, while the font changes only when the typeface is updated. If you prefer date-based names for both, or hash-like suffixes, that is your choice; the point is that the name signals a new asset rather than an overwritten one.
For each renamed asset, you can also write the intended long-lived header value on the same row, and add a short note naming the page or template that points to the old path. That note gives you a place to update links when you decide to switch. Keep the old row visible until you have confirmed the reference is gone; nothing here asks you to delete files or test a server.
Configuring Long-Term Caching for Immutable Resources
For static resources whose URLs carry a version or hash, MDN documents the cache-busting pattern: a resource's URL changes when its content changes, so the old URL is never reused for new content. The example given applies a long max-age value together with immutable to assets matched under an assets path: max-age=31536000, immutable.1
The immutable directive states that the response will not be updated while it is fresh. MDN explains it avoids unnecessary conditional requests when a user reloads the browser, because those versioned static resources are never modified. The same source pairs a no-cache directive on the HTML entry point, so the client receives the new HTML version and thereby the new static asset URLs.1
You can start with one row in your asset spreadsheet that still has a short cache lifetime, then rewrite that row so the intended header value and the filename agree. For example, if a row currently reads promo-banner.jpg with a Cache-Control value of one hour, you might draft a replacement pair: promo-banner-2025-04.jpg with a value meant to last a year. The example is yours to adjust; the point is that the filename change and the header change belong to the same decision, not two separate cleanups.
For clarity, write the draft as a sentence rather than a header string alone: “This file is named with a version stamp, so the header can allow a long cache and reuse across visits.” If your draft page already separates fingerprint-named files from unversioned ones, you can place this row under the first group and note in the row why it qualifies. You might also keep a matching row for a font file, such as text-regular-2025-04.woff2, so the same reasoning appears twice and is easier to review later.
Consider adding one line to your open-questions file about what should happen when a file keeps its old name after an image swap. Note the asset, the two options you are weighing, and who would decide. That keeps the question visible without turning it into a rule you have not settled.
Setting Revalidation Rules for Dynamic HTML Content
For dynamic HTML that must always be current, the documented guidance is to send no-cache, which requires caches to revalidate with the origin server before every reuse; this is distinct from no-store, which prevents storing. The source also states that omitting Cache-Control does not prevent heuristic caching, so a requirement should be stated explicitly. It notes max-age=0, must-revalidate as equivalent to no-cache, and cites no-cache as the simpler current choice.1
You can take your draft page on static-file header rules and add one short subsection for HTML documents, because the rules that work for fingerprint-named assets do not transfer neatly to pages that keep a stable address. For each HTML template, write a row noting its address, whether the content changes per visitor, and the revalidation value you intend. If a page is rebuilt on every deploy but served at the same path, you might draft a header that allows a short freshness window while requiring the browser to check back before reuse.
Consider writing two example rows in ordinary language rather than header syntax. A homepage rebuilt each morning might read: “shared copy may be reused briefly, then the browser should confirm freshness.” A signed-in account page might read: “do not store; always fetch fresh.” The contrast shows why a single value across all HTML is a poor fit for your own templates.
You might also annotate each row with the template or route that renders it, so the header decision stays attached to a real page rather than an abstract category. If you are unsure whether a page varies by visitor, mark that column as undecided and keep the row in your open-questions file until you can confirm it.
Applying Specific Directives for Proxy and Browser Caches
Cloudflare 's Cache-Control documentation separates directives into cacheability, expiration, revalidation, and other groups. Within cacheability, public permits any cache to store a response, private limits it to a single user's cache, and no-store requires both client and proxy caches to store no part of the request or response.2
For duration, max-age=seconds marks a response stale once its age exceeds that integer, while s-maxage=seconds overrides max-age or Expires for shared caches and implies proxy-revalidate; browsers ignore s-maxage. The documentation notes Cloudflare respects whichever value is higher, the Browser Cache TTL or the max-age header.2
Revalidation directives include must-revalidate, which applies to client and proxy caches, proxy-revalidate, which excludes private client caches, stale-while-revalidate and stale-if-error. The docs warn against pairing s-maxage with stale-while-revalidate, since s-maxage implies proxy-revalidate.2
Take the conflict-review note you drafted and give it one concrete job: compare the header rule for a single asset against the cache behavior you actually want for that asset. For example, if your spreadsheet lists a shared style bundle under a long cache lifetime while the draft rule says only fingerprint-named files should get that value, write both entries side by side in the note and pick the version you intend to keep. The note is then a record of a decision you made, not a second copy of the rules page.
You might also add a short comparison line for a font file. If the font keeps a stable name and rarely changes, one option is to keep its lifetime short and accept a little more revalidation; another is to rename it with a version stamp so the longer lifetime becomes safe. Write down which option you are leaning toward and why, in a sentence or two. That way the next person reading the note can see the reasoning without having to reconstruct it from an open-questions list.
Finally, you can mark the note as a working draft rather than finished guidance, and date it. If you later change the rule page, the note still shows what you weighed at the time, which makes it easier to spot when a later edit quietly contradicts an earlier choice.
Frequently asked questions
How can I start marking which assets to version first in my own spreadsheet?
You can take your own asset spreadsheet and mark one seasonal image and one font file as the two items to version first. For each, note the current filename, the new filename you plan to use, and where links to it appear, so the change is traceable before anything is renamed.
How can I draft a replacement filename and header value for one row with a short cache lifetime?
You can start with one row in your asset spreadsheet that still has a short cache lifetime, then rewrite that row so the intended header value and the filename agree. For example, if a row currently reads promo-banner.jpg with a Cache-Control value of one hour, you might draft a replacement pair: promo-banner-2025-04.jpg with a value meant to last a year.
How can I add a comparison line for a font file that keeps a stable name and rarely changes?
You might also add a short comparison line for a font file. If the font keeps a stable name and rarely changes, one option is to keep its lifetime short and accept a little more revalidation; another is to rename it with a version stamp so the longer lifetime becomes safe.