
| Category | Value (KiB) |
|---|---|
| Cold 200 | 80 |
| 304 | 0 |
| Fresh reuse | 0 |
Illustrative calculation (not sourced observations). Worked example for one 80 KiB HTML body. 304 can cost network round-trip and response headers despite carrying no body; reuse assumes a fresh stored response.
An article can open three times and display precisely the same text while doing three different things on the network. On Monday, the browser has no stored copy and asks for the HTML. The reply contains the article. On Tuesday, the browser asks whether its stored copy is still current. The reply says that the representation has not changed, and the browser displays the body it already has. Ten minutes later, a third navigation uses a fresh copy directly. The results might all look identical to the reader, but only the second trip merits a count in the server’s HTTP 304 column. The third may not appear in a server log at all.
That gap matters when someone takes a rising graph of 304 responses to mean that caching has improved. For an article site that changes its validation policy, rising 304s might mean fewer full downloads. It might instead mean more readers must wait for permission to use what they already have. On a media-heavy page, neither number may explain why the first paragraph or lead photograph appeared late. The useful question is not “How many 304s did we get?” It is “For which resource, at which boundary, compared with what, and for how many eligible reader loads?”
This guide designs a small benchmark around a single public article shell. Here, the shell is the primary HTML document delivered for a navigation, including markup in its response body. Scripts, styles, generated illustrations, fonts, search requests, and recommendation cards are not part of that response unless their bytes actually appear inline in that document. They can have meaningful caches and separate tests. Keeping the shell separate makes it possible to explain exactly what happened before moving to the harder problem of total experience.
Three reader loads, not three varieties of a hit
The figure compares three deliberately simplified loads of a hypothetical 80 KiB HTML response body. Its values are calculated examples, not measurements from a site, device, browser, or dataset. A cold 200 transfers the full 80 KiB body. A 304 transfers zero body bytes for that HTTP response. Fresh local reuse transfers zero body bytes because there is no network HTTP response for the shell on that load. The distinction between those two zeroes is the point of the chart, not an inconvenience to be averaged away.
The 304 still requires a request and response at the boundary where it is observed. That exchange has headers and uses a connection. The delay will depend on factors such as connection availability, the route to the responding server, and whether that server contacts something else. The chart excludes request and response headers in all three cases, packet and encryption overhead, other page resources, and rendering time. Nor does it claim the document's decoded size is 80 KiB in an actual browser: the result only follows from assigning 80 KiB to a full body transfer in the example. For a live study, decide and disclose whether body bytes are counted before or after content decoding.
A cold 200 is a full transfer as seen by the browser, not necessarily a miss at the edge. A nearby shared cache might have supplied the entire stored representation without asking the origin. Likewise, “cold” can describe an empty browser store even while a shared cache is warm. Mark the two independently. To force a true origin fetch, use a new controlled fixture or a documented test namespace and validate the result in origin logs; do not evict an entire production cache to manufacture a clean experiment. Protocol behavior is defined in RFC 9111, especially sections 4.2 and 4.3. The MDN HTTP Caching Guide provides practical context for browsers and intermediaries.
Draw boundaries before collecting numbers
On a whiteboard, draw the reader, the browser's HTTP cache, the shared edge, and the origin. Put a marker at each crossing. When the browser can reuse the document without network traffic, there is still a reader navigation and the browser still has to use and render a body. There is no new shell request at the edge marker. A browser conditional request crosses the first network marker. If the edge can answer using its stored information, nothing need cross the origin marker. Or the edge could send a conditional upstream request of its own. Each marker answers a different question: How many navigations used network? How many requests reached the edge? How many reached the origin? How many bytes came back across each link?
Make room for a service worker if the site uses one. A service-worker cache may return a stored document without consulting the browser HTTP cache in the way the benchmark expects. It might also do background work after replying. A history restoration, an open tab, a prerendered document, and an HTTP-cache reuse are not synonyms for one another. A landing page that looks instantly ready could either reuse its stored response or avoid creating a new document. For the core HTTP test, control those mechanisms and state how you did it. For a reader-experience study, keep them active and classify them as separate outcomes rather than attributing every quick result to fresh HTTP reuse.
These layers can produce a perfectly coherent result that looks contradictory on a dashboard. Suppose a reader has no stored HTML and gets a 200 from a shared cache. The client counts a full body; the origin counts nothing; the edge counts stored reuse. Another reader can use a stale local entry after validation. The origin might see a 304 while the edge serves a 200 with a body to a different unconditional request. The wire status at one link does not describe what happened at every other link. Even a single transaction lends itself to several statements, all true within their boundaries. Choose those boundaries before collecting data so a favorable-looking interpretation cannot pull you to a different one afterward.
Separate freshness from the decision to store
One of the easiest traps is treating an entity tag like a policy for how long a copy can be kept fresh. The tag serves as a validator for a selected representation. Freshness is determined separately from the response's caching metadata and the cache's calculated age, subject to applicable rules. A stored response can be reused while fresh without sending its tag; a stored response that needs validation may provide a tag with the request. No amount of change in tag design reduces the trip needed to validate a document the policy requires the browser to validate on each reuse. Conversely, extending a freshness window by itself does not improve the fidelity of a validator.
For public HTML that is eligible for storage, a positive freshness window gives the publisher a concrete tradeoff: readers may reuse a copy during the window, which cuts out a trip, but a regular navigation may not see a correction immediately. The window is a policy choice and a test variable. Request directives or reload modes can require different behavior; an existing matching response might also have been evicted. Never publish a performance estimate that quietly assumes every repeat view arrives while the stored response is still fresh. Look at the distribution of actual revisit intervals or report multiple policies without trying to predict what readers will do. Use the specific interpretation of freshness and age in RFC 9111, section 4.2.
Two similarly named directives are worth getting right. As response directives, no-cache generally allows storage but requires successful validation before reuse; no-store tells caches not to store the response. They are not two spellings for the same control. Changing either can affect readers beyond the specific path you benchmarked. Do not test policy against private previews by making them public or by treating a validator as an access control. Establish an anonymous public fixture and separately verify that authenticated or personalized content meets its own access and storage rules.
Validators you can test without guessing from the markup
A practical fixture offers two publications of the same URL. Both are public. Both have the same test policy except for their publication timestamp and validator. Put a clearly different editorial marker in each body, such as a short edition line visible near the heading. Do not change the URL for the correction test: the question is whether a stored response for the old URL will be refreshed. Do change versioned asset URLs where that matches the real publishing pipeline, so the HTML exercise does not accidentally rely on independently stale dependency bytes.
An entity tag is an opaque server-provided value. On a normal conditional GET made with the appropriate existing tag in If-None-Match, an unchanged selected representation can elicit 304. With a changed representation and a nonmatching tag, the normal successful result is a response containing the new body. The setup must make the tag reflect the representation actually sent. It is not enough to generate a tag based solely on the title or the calendar day if the correction can change body content independently. Do not manufacture a weak tag by editorial intuition and then assume it proves two encoded bodies are byte-for-byte identical. A weak validator supports equivalence under HTTP rules without certifying identical bytes. In either case, test both the unchanged and corrected editions; an always-matching tag can make the first test look excellent and the second fail outright.
A Last-Modified value is another validator, associated with If-Modified-Since. Use enough separation between change timestamps that the test does not collide with the granularity of the values being compared. If a request includes both validators, If-None-Match takes precedence over If-Modified-Since; do not use a date-based expectation to adjudicate such a request while ignoring its tag. If you are testing a date-only fallback, omit the tag for that fixture deliberately and record that difference in the run. If the publishing platform cannot supply a meaningful modification date, a precisely tracked tag can be the more intelligible primary fixture, with the date path out of scope rather than falsely verified.
Inspect the full transaction when a 304 occurs. A validator reply can update stored metadata, not just give permission to reuse an old body. If the reply changes caching policy, it can change what happens on the following load. Save headers from the initial response, the validation response, and the next fetch or reuse. Check the value of the article marker after each action; the sequence of status codes alone cannot establish correctness. These distinctions follow the validation model in RFC 9111, sections 4.3.1 through 4.3.4. The proposed edition markers and paired trials are benchmark design, not requirements imposed by the standard.
Cache keys and the representation actually in front of you
The article address is a starting point but not sufficient evidence that two requests select the same representation. The public page could offer localized variants, an edge could encode different versions according to Accept-Encoding, or a site could otherwise vary its HTML in response to a request field. The role of Vary in selecting stored responses is described in RFC 9111, section 4.1. Inspect the actual response and platform configuration rather than assuming that a default browser user agent tells you which variant the cache selected. Also account for relevant browser cache partitioning and any explicit tests performed inside a different top-level site.
Make a small representation matrix. For example, select one normal browser configuration and one explicitly supported language configuration, holding everything else fixed. Record the URL including query, redirect destination, selected language, content encoding, any request headers relevant to Vary, and applicable cache policy. If HTML is identical across device sizes and only CSS changes presentation, mobile versus desktop does not have to be treated as two representations for this reason alone. If the platform really serves separate HTML variants, record the selection evidence and compare like with like. Dimensions set by a browser emulator do not by themselves prove the response is mobile-specific.
On sites that serve anonymous and signed-in views, run a separate deployment-safety check to show that an anonymous reader cannot receive a signed-in rendition from shared storage. Use dedicated non-sensitive test accounts and anonymous isolated contexts; do not place secrets, session identifiers, or private navigation traces in the article or benchmark evidence. If a fixture says public yet its HTML contains reader-specific material, stop the public-cache benchmark and resolve that mismatch. Mark the public and private tests separately in any handoff. An impressive improvement in full body transfer rates cannot excuse wrong-user content or leakage across contexts.
URLs with tracking queries deserve a deliberate decision too. Do not tack a random query on every sample and then call the result a typical ordinary-navigation test. Such a query may change the cache key, bypass storage, trigger redirect logic, or alter other behavior. For normal trials, leave the URL unchanged across priming and repeat visits. For explicitly cold trials, use a new browser state or a distinct controlled published path and say which dimension you reset. If query canonicalization is itself under study, isolate it, record actual redirect steps, and compare profiles with identical query sets. The redirect can have a network cost even when the final document is already fresh.
Build a fixture that is safe to repeat
Before the test date, write down the questions the fixture is meant to answer. A good initial set is: Will an ordinary repeat navigation to unchanged HTML skip the browser-to-edge exchange while its document is fresh? Will a repeat navigation under a validated-only policy send a conditional and use the existing body? Will a published edit generate a full new transfer once a configuration requires validation? Then give each case one controlled setup and one passing criterion. Put the stale and changed cases next to the unchanged cases in the test report; correctness must not depend on the reader trusting that someone tried an actual update.
Use a fixture served by the same delivery layers as the real public route if feasible. A localhost-only simulation is valuable for checking the harness but cannot answer whether a particular edge configuration honors the intended controls. A production-like test URL without reader traffic offers a safer middle ground. Seed it with an HTML document and revision markers with no private content. Give each cohort a fresh context or a known starting snapshot, keep the evidence from the priming run, and then verify that the context is still alive before testing stored reuse. The clean room should remove confounders without disabling browser caching entirely. A debugging flag that blocks the cache can make every case resemble the cold test.
Plan the sequence around clocks rather than racing to click. For the fresh case, choose a policy and schedule the second navigation clearly inside its effective freshness lifetime, leaving margin for time already spent in shared storage. For the stale case, wait until the response should actually need validation, or use a fixture deliberately requiring validation. Record which version you used. Those are related but not equivalent tests. Setting a one-second lifetime and waiting a little over a second is prone to timing ambiguity. Use more separation, capture relevant response metadata, and treat uncertain runs as uncertain instead of silently labeling a suspected status with the predicted outcome.
Publication policy changes deserve their own fixtures. A stored response governed by the previous policy cannot retroactively receive a new header until it is reached and updated, evicted, or otherwise replaced. A rollout that makes future HTML responses revalidate more often does not guarantee that browsers holding fresh older copies get the new behavior immediately. Demonstrate that distinction by priming against an old response, changing the policy while its old window still exists, and reporting what the old and new browser cohorts see over time. Use a test asset or synthetic article marker, never intentionally serve an outdated warning or correction to readers just to make the point.
A run sheet for cold, fresh, stale, and corrected loads
For a browser-cold trial, start with an isolated browser context that has not loaded the document. Navigate through the same canonical URL every time and verify that the target document is actually displayed. Keep any redirects as separate observations and write down whether the edge was intended to be warm or cold. A full 200 received at the browser is the expected core control; a missing network request is a reason to investigate the fixture, not a speed record. Repeat the control with a new context for each sample when the objective is browser cold behavior.
For the fresh trial, preserve the state created by the prime. Navigate away to a simple same-site page, then navigate normally to the article URL without using back or forward and without pressing refresh. Do not launch a new private context for the second action. Record whether any browser-to-edge request took place for the resource, whether the article marker appeared, and whether the trace supports HTTP-cache reuse rather than a different mechanism. A stored response may be reported with its original successful status in tooling because that is the response being consumed, even though the network did not receive a new HTTP 200. Corroborate with the request-level evidence instead of treating the display label like a wire capture.
For a stale unchanged trial, prime the same fixture and allow its policy to require a new validation. Confirm that the outbound document request actually has a conditional field and that the 304 was returned at the boundary being studied. Confirm the old marker still appears correctly. If the browser chose not to store the response, this condition may generate a full 200 instead; that is an observation worth reporting. Record the presence of a conditional field separately from the status so you can tell the difference between a stale validation that delivered a body and an ordinary full request. For a reload trial, test ordinary reload and any hard reload separately, calling them reloads. They are not substitutes for a normal revisit.
For the correction trial, publish the new fixture revision with a demonstrably different body, wait for the chosen test policy or deliberately validate under a policy that already requires it, then repeat the navigation. A newer marker must appear where the policy says it should. A 200 alone does not pass: it could be an unconditional full copy of the old edition. A browser might still reuse the old edition while it is legitimately fresh, which is a separate editorial latency result rather than a protocol failure. Test at least one scheduled point after the intended correction window. If the old marker remains, inspect the upstream body, tag, variant, and effective freshness before proposing a remedy.
When your target is specifically a conditional edge transaction, a controlled HTTP client can make a useful independent check: first retrieve a known tag, then send a conditional GET for precisely the same selected representation. That confirms what the server path does with that request; it never demonstrates that an ordinary browser would send the request in the first place. Tools that send a request every run do not model zero-request browser reuse. A HEAD request may be useful for a separate header probe, but does not substitute for the document navigation or its body classification. Write down the method whenever you cite a raw result so it does not get mixed into load counts.
Keep a small evidence packet per trial rather than a video of the screen alone. Include fixture ID, cohort, browser version, a monotonic clock interval where available, navigation action, document identity, request classification, cache-service indicators, status actually observed at each boundary, received body size or size evidence, edition marker, and why each outcome was assigned. Store timestamps and per-run capture references, not readers’ unnecessary personal data. If you can link the same transaction through the edge and origin using a controlled environment's logs, do so; if not, say where proof stops. It is still useful to report that you verified client behavior without an origin-level count.
Denominators are part of the definition
Start with eligible document navigations in the cohort, not all network requests on the page. Count one final target document per eligible load and account for cases such as redirects and aborted loads with explicit rules. For the principal shell comparison, it is reasonable to report fresh local HTTP reuse divided by all eligible navigations. Keeping unknowns in the denominator avoids claiming certainty the instrumentation did not earn. If you additionally report a fraction among known cases, label it clearly and show how many were unknown. Deduplicate retries and separate requests for images, fonts, and other documents.
The client-facing validation ratio answers a different question: 304 responses to conditional document requests divided by the number of conditional document requests reaching the measured server boundary. If the only available logs contain all document requests, 304 responses divided by all logged document requests is a third ratio, which you can describe as the request-weighted 304 share. None of those ratios is a reliable denominator for fresh local reuse. An edge can compute a shared cache rate according to its documented classification, but the numerator and denominator are edge properties and can differ from both browser and origin measures. Report whether validation at the edge is included in whatever your platform calls a hit.
Here is a wholly hypothetical cohort picked to make the arithmetic transparent. There are 200 eligible article loads. Seventy use fresh local HTTP copies directly. Fifty make successfully validated conditional requests returning 304. Ten make conditional requests that return full new 200 bodies. Sixty-five receive full 200 bodies after nonconditional requests. Five are unknown at the client boundary because the trace was incomplete. The confirmed fresh local reuse fraction is 70 out of 200, or 35%. Counting verified classifications only gives 70 out of 195, about 35.9%, but that second number excludes the missing evidence and should not replace the first. The counts of unknowns and eligible loads should appear alongside percentages.
At the browser-to-edge boundary in that same example, there are 125 known document requests: 50 plus 10 plus 65. Of 60 known conditional requests, 50 returned 304, about 83.3%. Of all 125 known requests, 50 returned 304, or 40%. If someone says the browser's cache hit rate was 83.3%, the numerator is the right count for a different question, but the claim is wrong. If someone adds the 70 local reuses and 50 validations and reports 120 of 200 without naming the metric, they have mixed branches too. It would be fair to call that 60% of eligible navigations with confirmed avoidance of a newly transferred document body. It would be false to say 60% navigated without a network request. This worked example is separate from the article's figure and does not change the figure's three per-load values.
Suppose that in an illustrative comparison 10 304s become 30 after deploying a policy that requires more validation, with the same number of trial loads. That increase could mean that formerly fresh local reuses now pay for a round trip. Or formerly full transfers could now avoid bodies thanks to a new, reliable validator. You need the rest of the outcome table to know which shift occurred. The single most valuable reporting improvement is often a table with the same classification columns before and after the change, with identical definitions and a prominent unknown column. It forces the observer to show what happened to the missing mass.
Byte totals and latency answer different reader questions
Capture enough to report body bytes and time separately. Encoded body bytes tell you about transfer for a particular content coding; decoded bytes tell you about representation size after decoding. Transfer-size fields may have API-specific definitions, visibility restrictions, and behavior for reused responses. A browser's timing entry can be evidence, but its numeric fields do not replace it. Before drawing conclusions, compare a sample against a browser network protocol trace or a controlled server log and document cases where the source cannot fully distinguish the options. Do not sum a decoded body size for reused responses and call the result network traffic.
Measure at least two intervals relevant to the shell: elapsed time from navigation start to a consistently defined first document response milestone, and an end-to-end reader milestone such as the time when an article heading or first paragraph is rendered. The first is not sufficient to predict the second. A 304 still leaves markup parsing and painting to be done; fresh reuse avoids a trip but may still compete for CPU with scripts or image decoding. You can measure more milestones, but preselect the ones that support decisions. Otherwise the experiment risks finding the wrong reason for improvement: changing the image delivery could make the first heading feel faster while leaving HTML caching unchanged.
Use a stable network setup first, then run a separate slow or mobile-like condition. Vary latency deliberately rather than accidentally comparing a warm desktop connection with a cold mobile connection in a different region. A 304 on a preestablished connection is not the same as a 304 reached through connection setup, and an edge geographically close to the test client can respond very differently from an edge that needs upstream validation. Keep device, browser, rendering mode, and network state comparable. Start with one matched connection state; expand the matrix only when the narrower experiment is understood. Order trial groups so that a background deployment or network change is unlikely to affect just one condition.
Show distributions along with the sample counts, and choose percentiles your sample can support. A reported tail percentile from a handful of clicks mostly advertises your worst single run. If the initial sample is small, report a median and individual or range observations, mark the exercise as a smoke test, and reserve larger cohorts for a percentile comparison. Prefer the same decision threshold and cohort construction before and after a change. An operations team may care about aggregate reduction in outgoing origin bytes, while editors may care about correction visibility within a stated window. A satisfactory result for one requirement does not imply success on the other.
Make a policy change earn its way into production
Use the benchmark to compare operational choices, not to chase the highest cache percentage. An evergreen public article whose corrections can tolerate a modest delay is a different case from a rapidly changing news page. A fingerprinted illustration with a version-specific URL is different again. For the first, a carefully chosen freshness lifetime with working validation when that lifetime expires can be a good candidate to evaluate. For the second, tighter validation may be preferable to a bigger fresh reuse number. For an immutable asset that will always get a new URL when the bytes change, long-lived caching has different invalidation costs. The MDN HTTP Caching Guide describes the versioned-asset pattern. It should not be misapplied to mutable HTML navigations.
Take two counterexamples to the rollout meeting. First, imagine the shell reports zero response body bytes on nearly every repeat because it validates on every load. If geographically distant readers still see a lag before any article text, the body-only chart does not answer the latency concern. Second, imagine a fast repeat path that continues showing an outdated correction beyond the editorial commitment. No-render-delay success does not excuse an error in refresh policy. Set independent acceptance criteria for performance, editorial correctness, and public-versus-private behavior. If any fails, keep the prior rollout plan or revise the testable mechanism rather than averaging the failures into one overall score.
A small rollout is also easier to reverse when the benchmark has visible edition markers, consistent URL rules, and both new and primed readers. Before release, stage a test change and deliberately exercise the rollback path. A reverted origin file does not immediately revoke an old fresh cached copy, and a large edge purge is not necessarily an appropriate remedy for a browser-local response that will not contact the edge at all. Confirm what a new navigation gets at each layer and what older profiles see before the old lifetime expires. Keep the trial restricted to a designated route or cohort; do not sacrifice real correction visibility to prove an abstract point.
Ownership matters once a dashboard survives the launch. Put an editor and a delivery engineer on the metric review, with the exact response-boundary definitions included next to the graphs. The editor can decide whether a document is actually the intended revision. The engineer can determine which hop served it and why the outcome belongs in a given column. If either definition changes, mark the graph discontinuity or recalculate using comparable evidence rather than implying historical values had the new meaning. Save the synthetic fixture and the conditions that gave you the expected three results, so a future migration can reuse the benchmark rather than reconstruct its assumptions.
What a defensible result looks like on one page
Lead with whether the current document arrived and how often a new body was transferred. Then state how many eligible navigations there were, how many skipped the browser-to-edge shell request, how many made a conditional round trip, how many needed a full body, and how many could not be classified. Report edge-to-origin results in a separate paragraph even when the systems belong to the same publisher. Include protocol and environment notes: ordinary navigation versus reload, the tested representation, whether a service worker was excluded, how body bytes were determined, and the date or fixture version. If the result is only for one browser and one region, say so explicitly.
A concise conclusion might read: “In our representative test cohort for public article navigations, fresh local reuse became more common. Conditional validation returned zero body bytes when the article was unchanged, but still made a request; the latency table includes that cost. The correction test delivered the new edition after the policy's intended window. Origin load was measured separately. Some traces were incomplete and remain unclassified.” Only use the conclusion when the supporting counts show each claim. In particular, a chart with the 80 KiB illustration is not evidence for the statement; attach actual logs and trial results to the report if citing actual behavior.
Before calling the benchmark finished, ask a reviewer to reconstruct one run of each case using only the evidence cards. Can they find a full representation on the client-cold control? Can they tell that a 304 came from the browser-facing leg rather than an upstream validation invisible to the browser? Can they show that a no-request load was fresh HTTP reuse and not a history restoration? Can they recover the edition marker for the changed case? If they can reproduce the classification and the aggregate denominators, a future rise or drop in 304s becomes interpretable rather than alarming by itself.
If the trial fails, isolate the layer before changing policy
An unexpected full transfer in the fresh cohort calls for a narrower rerun: preserve one browser context visibly, confirm that the first request and resulting navigation used the same final document address, then compare the origin policy with the headers actually received. If the right document size appears in an API entry but the trace shows no request, the size definition may be the problem, not cache reuse. If the stale cohort has almost no 304s despite sending conditionals, compare the selected representation and validator recorded for the prime with the second request. Repeating large cohorts before resolving these basic contradictions wastes effort and can conceal a defect behind a very stable average.
Treat every unresolved observation as unknown in the published benchmark. You can later rerun it with better instrumentation, but keep the original run history intact. That preserves both the editorial audit trail and the engineering lesson: only count what the evidence can distinguish.
References
- RFC 9111: HTTP Caching: normative reference for cache selection, freshness, response directives, reuse and validation.
- MDN: HTTP Caching Guide: browser and shared cache context, validation examples and resource versioning.