Caching arguments usually stop at Cache-Control. The second half of the deal is revalidation: when the browser does come back and ask, how much has to move for the answer "nothing has changed"? That part is measurable from outside with nothing but curl, so I measured it on all 76 public pages of Nakodo, a Next 16 app on Vercel.
The sweep
Read the sitemap, take each URL's ETag, ask for the page again with that ETag, record the status:
curl -s https://nakodo.app/sitemap.xml \
| grep -o '<loc>[^<]*</loc>' | sed 's/<[^>]*>//g' > urls.txt
while read u; do
et=$(curl -sI "$u" | tr -d '\r' | awk -F': ' 'tolower($1)=="etag"{print $2}')
code=$(curl -s -o /dev/null -w '%{http_code}' -H "If-None-Match: $et" "$u")
echo "$code $u"
done < urls.txt
The result is clean in a way that measurements rarely are:
| Pages | |
|---|---|
ETag, and If-None-Match returns 304 |
74 |
| No ETag, so no conditional request is possible | 2 |
The 74 carry cache-control: public, max-age=0, must-revalidate and a strong ETag. The two without one are the home page and the pricing page, and they carry private, no-cache, no-store, max-age=0, must-revalidate.
What the 304 is worth
The 74 cacheable pages are 36,812,720 bytes of HTML between them, averaging 497,469 bytes, because this site draws its illustrations as inline SVG and the biggest page, the glossary, is 526,929 bytes of mostly repeated line art.
A revalidation of that page costs this:
200: 603 header bytes + 526,929 body bytes
304: 193 header bytes + 0 body bytes
So a crawler that keeps ETags and comes back daily moves 193 bytes a page instead of half a megabyte, and the whole site answers in about 14 KB of headers rather than 36.8 MB. None of that is our work. It is what a static prerender on this platform gives you, and the only reason it is worth checking is that two of the pages do not get it.
The two that cannot
Both exceptions read a request header on the server:
export async function displayCurrency(): Promise<Currency> {
if (BOT.test((await headers()).get("user-agent") ?? "")) return BASE_CURRENCY;
return currencyForCountry(await requestCountry());
}
One await headers() makes the route dynamic, a dynamic route gets no-store, and a no-store response has nothing to validate against, so those two pages are a full download every single time: 596,361 bytes for the home page and 519,933 for pricing.
That is the right trade and it was made on purpose. Prices on those two pages are shown in the visitor's own currency, and the number on the page is always the number Stripe will charge. A cached copy would show someone in Toronto a price in pounds, and the alternative (ship every currency to the browser and pick one after hydration) swaps a correct page for a page that flickers. Two pages paying full price for correctness, 74 pages revalidating for 193 bytes, is a deal I would take again.
Every URL has two ETags
The same URL serves two different documents, depending on whether the router or the browser is asking:
$ curl -sI https://nakodo.app/about | grep -i etag
etag: "191e550cd685e5f2f1ef89d8a6f0ad3c"
$ curl -sI -H 'RSC: 1' https://nakodo.app/about | grep -i etag
etag: "4a1fec94d020ce246787654a80fdd5f3"
The second is the React Server Components payload, content-type: text/x-component, which is what a client-side navigation fetches instead of HTML. Each has its own validator, each gives its own 304, and offering one against the other gets a 200 with a full body both ways. The field that keeps them apart is on every response:
vary: rsc, next-router-state-tree, next-router-prefetch, next-router-segment-prefetch
Four request headers participate in choosing a representation, so 76 URLs are at least 148 cache entries before anything else varies. This is the part of HTTP caching that nothing in your code mentions and everything in your framework depends on.
The browser invents a weak validator
Watching a repeat visit through the DevTools protocol shows the request header the browser sends by itself:
REQ if-none-match: W/"191e550cd685e5f2f1ef89d8a6f0ad3c"
RESP 304 (from Network.responseReceivedExtraInfo)
responseReceived status: 200, encodedDataLength: 85
Three things in four lines.
The W/ prefix is not ours. The server sent a strong ETag; the browser stored a brotli-encoded response and kept the decoded bytes, so it can no longer promise byte equality and it weakens the validator on the way out. That only works because If-None-Match is required to use weak comparison, which the CDN honours: asking with W/ in front of a strong ETag gets the same 304 as asking without it. A server that compared strongly here would turn every repeat visit on a compressed site into a full download.
The second is that Chrome's own network log says 200, not 304, because by the time the response is reported the browser has merged the 304 with the cached body and is telling you about the document it ended up with. The real status is only in the extra-info event. The giveaway in the normal log is the size: 85 bytes for a page whose body is half a megabyte.
The third is Network.responseReceivedEarlyHints, a 103 on the document request, which I had not known this site sends.
Two things the responses do not say
RFC 9110 is explicit that a 304 must carry the header fields it would have sent in a 200 for ETag and Vary. Ours carry neither:
HTTP/2 304
cache-control: public, max-age=0, must-revalidate
date: Tue, 17 Nov 2026 11:10:53 GMT
server: Vercel
x-vercel-cache: HIT
In practice no client cares, because a client that got a 304 already holds the validator it just sent. It still means an intermediary that learns about a resource only from a 304 learns neither its validator nor what it varies on.
The other absence is ours to own: not one of the 76 pages sends last-modified. A client that only speaks dates gets no help at all.
$ curl -s -o /dev/null -w '%{http_code} %{size_download}\n' \
-H "If-Modified-Since: Wed, 01 Jan 2031 00:00:00 GMT" \
https://nakodo.app/glossary
200 526929
A date from the future, and the full page comes back. Every page in our sitemap carries a lastmod, so a date per page exists somewhere in this system; it is not in the responses, and nothing in a prerendered Next app puts it there. It is also not in good shape, since all 76 of those dates currently read 3 October, which is a separate thing I need to fix.
The copy being served is a week old
The last pair of numbers surprised me:
age: 665326
x-nextjs-stale-time: 300
x-vercel-cache: HIT
Just under eight days. There has been no deploy in that time, these pages are prerendered at build, and their content comes from a TypeScript registry rather than a database, so a seven-day-old copy and a freshly rendered one are the same bytes. must-revalidate with max-age=0 means every browser asks every time and almost always hears 304, which is exactly the behaviour you want for content that changes only when somebody ships.
Static assets take the opposite deal, and their ETag is the best joke in the sweep:
cache-control: public,max-age=31536000,immutable
etag: "_next/static/immutable/chunks/09u01js-6w-cw.js"
The validator for an immutable file is its own path, which is content-addressed anyway, so the ETag has nothing left to say.
What I am changing
Nothing, which is the honest answer, and worth saying out loud after a measurement: 74 of 76 pages revalidate for 193 bytes, and the two that do not are dynamic for a reason I would defend to a regulator rather than to a profiler. The one open item is last-modified, which would give date-only clients something to revalidate against, and which needs the per-page dates sorted out first. You can check any of it yourself: the guides index, how it works and the glossary all answer 304 to their own ETag, and the pricing page never will.
Top comments (0)