Independent consultants often host static sites where efficient caching improves load times. This article clarifies the specific directives needed for hashed assets versus main entry points, using standard HTTP semantics.
Scenario: A consultant updates a portfolio page but visitors see old content
This is a hypothetical scenario: an independent consultant runs a small static portfolio site with a home page, an about page, and a work-samples page. After editing the work-samples copy, the consultant reloads the live page and still sees the previous wording. The likely culprit, when the site is served through a CDN, is a long max-age directive on the HTML response.
To make the issue concrete, suppose the consultant works with two candidate page files and a short list of cache rules. The home page is stored as index.html, and its title in the author’s own notes is “Portfolio home.” The work-samples page is stored as work.html, titled “Selected work.” The author drafts a first rule set: for HTML, Cache-Control set to public, max-age=0, must-revalidate; for hashed assets such as app.3f9c2.js, Cache-Control set to public, max-age=31536000, immutable. This is an example choice, not a tested configuration. The reason for the split is that HTML needs to be rechecked often because it names the current asset versions, while a hashed file can be cached for a long time without the same risk.
A second candidate surfaces in the author’s notes: instead of max-age=0, use no-cache for HTML. The author marks this as the preferred option because no-cache still allows storage but requires revalidation before reuse, which fits frequently edited pages. The rule set becomes a three-line table in the author’s draft: file type, Cache-Control value, and reason. Example rows use index.html with no-cache because the page changes; app.3f9c2.js with max-age=31536000, immutable because the filename changes when the content changes. A further example row names a sample image, photo-04.jpg, with max-age=604800, a one-week lifetime, because it changes rarely and is not versioned in its filename.
Two example records show how the table is filled and read. Record one: index.html, public, no-cache, revalidate before reuse. Record two: app.3f9c2.js, public, max-age=31536000, immutable, safe to keep for a year. These are illustrative entries written by the author, not production values. The table is deliberately short so the consultant can check each row against the actual HTML and asset names before publishing.
Defining cache behavior with standard HTTP directives
The Microsoft Learn documentation for ASP.NET Core response caching states that the primary HTTP header for caching is Cache-Control, which specifies cache directives. It lists public as allowing a cache to store the response and private as barring a shared cache from storing it while a private cache may store and reuse it. max-age tells the client not to accept a response older than the specified number of seconds, with max-age=60 and max-age=2592000 (one month) given as examples. On the request side, no-cache means the cache cannot use a stored response and the origin server regenerates it; on the response side, the response must not be used for later requests without validation by the origin server. no-store forbids storing the request or any part of the response.1
For the work-samples page, you can begin by locating the Cache-Control response header that applies to the HTML file itself, then decide which standard directive matches how often that copy changes. If you revise the wording regularly, consider pairing a modest max-age with a validator so returning visitors revalidate rather than reuse a stale copy; if the page is stable, a longer max-age may suit it better. You might record the chosen directive and the reason beside the filename in your notes, so the next edit does not reopen the same question.
A useful self-check is to write three candidate headers for the same file and compare them in plain words. For example, one candidate might allow reuse for an hour, another might require revalidation on every visit, and a third might combine a short reuse window with revalidation. You can mark which candidate fits the work-samples page, which fits the about page, and why, treating these as your own working choices rather than measured results.
If you later archive an older announcement, you can reuse the same note fields with different values: the archived item might allow longer reuse, while the current announcement keeps a shorter window. Recording both entries side by side helps you see whether a stale view comes from the page rule or from something else, and you can adjust the HTML rule first before changing anything else.
Applying long-term caching to versioned static assets
The MDN Cache-Control reference describes the cache-busting pattern for static resources: include a version or hash in each asset's URL, such as a script or image path, and never modify the resource in place. When an asset changes, give it a new version number or hash so its URL is different, and the old cached response is not reused.2
For assets that follow this pattern, MDN shows a long max-age value plus immutable, illustrated as max-age=31536000, immutable for the assets path, because the content at that URL will never change. The immutable directive tells a cache the response will not be updated while fresh and avoids unnecessary conditional requests when a user reloads the browser. MDN notes immutable is a generalization that some implementations do not recognize, so this suits versioned assets only.2
For a versioned asset such as app.3f9c2.js, you can now pair the header you have just reviewed with a short, repeatable check of your own files rather than reaching for a new tool. Consider listing each asset beside the fingerprint it carries and the reuse window you intend. A filled example: asset name, app.3f9c2.js; change marker, the 3f9c2 segment; intended header, public with a long max-age and immutable; fallback version, app.7a1b4.js. The point of the fingerprint is that any edit produces a new marker, so the old file never needs its reuse window shortened. You might keep a second row for a font file, for instance fonts/inter.9d2e1.woff2, marked the same way, and a third row for a small icon whose name has no marker, where you would choose a shorter max-age or add a marker before applying the long window.
A quick self-check you can write in your own notes is to ask, for each row, what happens on the next edit. If the answer is that the file name changes, the long window is safe to choose; if the name stays the same, you can decide to rename it or to accept a shorter window. The choice remains yours, and the table is only a record of the decision, not a requirement.
Configuring validation rules for HTML entry points
For an HTML entry point, MDN’s Cache-Control reference cites this example: applying no-cache to /index.html. It states that no-cache lets a response be stored but requires validation with the origin server before each reuse, even when the cache is disconnected from the origin server. The directive therefore does not mean “don’t cache”; the reference assigns that meaning to no-store.2
The reference notes that no-cache could cause revalidation, so the client receives a new version of the HTML response and static assets. It also separates this from the cache-busting pattern: a long max-age plus immutable is shown for versioned assets whose URLs change, not for the HTML file.2
You can now turn the suspected long max-age on the work-samples HTML response into a short decision note of your own. Write one row per page file: file name, intended freshness, chosen directive, and a plain-language note for why. In the work-samples row, you might record the problem you observed—edited copy still showing—then set freshness to “revalidate before each reuse,” choose no-cache for the HTML, and write the reason as “page text can change without the file name changing.” This is a hypothetical planning example, not a measured result.
You can keep that row beside the hashed asset row you already noted. If the work-samples asset is named app.3f9c2.js and the name changes with each edit, you might give it a longer public freshness window while leaving the HTML row at revalidate. The contrast in the two rows is the check: ask whether the file name changes when the content changes; if it does not, the longer window belongs elsewhere.
If you also maintain an archived announcement, consider a second pair of rows using the same fields. The archived HTML might allow longer reuse because its wording is fixed, while the current announcement keeps the revalidate choice. You can choose to add these rows or leave the archive out for now; the point is that the same fields let you compare current and archived entries without mixing their reasons.
Handling conflicting directives and restrictive policies
The MDN source states that if directives conflict, the most restrictive directive should in theory be honored. Its example lists private, no-cache, no-store, max-age=0, and must-revalidate together as effectively equivalent to no-store, because no-store says caches of any kind should not store the response.2
The source also distinguishes no-cache from no-store: no-cache allows storage but requires revalidation before each reuse, while no-store is the directive to use when the intended meaning is “don't store.” It notes that no-cache does not guarantee revalidation for history navigations such as the Back button, since the back/forward cache can restore a snapshot without revalidating.2
You can start by writing a short conflict note for the work-samples page itself, since that is the file where the stale wording appeared. In the note, record the header you found, the directive that seems too permissive for HTML, and the wording change you expected to see. Then consider which of your page files should carry a shorter reuse window and which can safely keep a long one.
A useful next step is to compare two candidate headers for index.html in plain words. One candidate might set a long max-age, favoring speed but leaving edited copy invisible until the cache expires. Another might set no-cache with revalidation, favoring freshness at the cost of a request each visit. You can mark which candidate fits each page, and note why, without treating either as a rule for every site.
You might also write a short field set you can reuse later: file name, intended audience, chosen directive, and the reason for the choice. Filling one row for the work-samples HTML and one for a versioned asset such as app.3f9c2.js shows where the directives should differ; if the asset name changes with each edit, a long reuse window becomes easier to justify.
Verifying header implementation in server responses
You can verify what the server actually returns by inspecting the response headers for each page file in your browser's developer tools, rather than assuming the header you intended is the one being sent. Open the network panel, reload the work-samples page, and select the request for the HTML document itself; the response section will list the Cache-Control value along with any other caching headers. You might do the same for the hashed asset request so you can compare the two side by side. This check belongs in your own notes as a before-and-after record: what you expected versus what arrived.
A practical way to keep this organized is a small comparison sheet with a few plain columns. For example, you could use file, destination, observed directive, and next action. A filled row might read: work-samples page HTML, returning visitors, max-age with a long window, shorten or switch to revalidation so edits appear promptly. Another row could read: app.3f9c2.js, returning visitors, long max-age, leave as is because the file name changes each build. You can choose the columns that fit your own material; the point is to record observations, not to prescribe a format.
If the observed header does not match what you configured, you might check whether a CDN or proxy layer is adding or overriding it, since the response reaching the browser can differ from the origin's settings. That is a question to note and investigate in your own setup, not something to settle from the browser panel alone. Consider repeating the check after any change and keeping the older record, so you can see whether the edit took effect.
Finally, you can write a short confirmation line for each page: the file name, the date you checked, the header value you saw, and whether it matches your intended rule. A hypothetical entry might read: about page HTML, revalidate before reuse, matches intent. Keeping these lines beside your earlier candidate-header notes lets you decide, page by page, whether the stale wording problem is resolved or still needs attention.
Frequently asked questions
What fields should I write in a row for each page file when turning a suspected long max-age into a decision note?
You can now turn the suspected long max-age on the work-samples HTML response into a short decision note of your own. Write one row per page file: file name, intended freshness, chosen directive, and a plain-language note for why.
What fields can I write once and reuse later for my own cache preference notes?
You might also write a short field set you can reuse later: file name, intended audience, chosen directive, and the reason for the choice.
What columns could I use in a small comparison sheet for keeping this organized?
A practical way to keep this organized is a small comparison sheet with a few plain columns. For example, you could use file, destination, observed directive, and next action.
ASP.NET Core 中的响应缓存 | Microsoft Learn . Retrieved 2026-11-21. ↩︎
Cache-Control header - HTTP | MDN . Retrieved 2026-11-21. ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎