A promo box is a small thing. Ours sits under the free quiz question pages and says, in effect, "if you want a whole night's quiz ready to run, here is the paid one, and here is the price". The price has to be in the visitor's currency or it is worse than no price at all. So the box reads the visitor's country, and that one read decides how the page is built.

I changed the box this week to show prices in the visitor's currency. This post is what that does to caching, measured on the live site rather than argued about, because "this component makes the page dynamic" is a sentence I have written in a code comment and never put a number next to.

The line that does it

export async function PackPromo({ pack: which, lead }) { const pack = publicPack(/* ... */) if (!pack) return null const currency = await getDisplayCurrency() // ... } 

getDisplayCurrency is one call, headers() from next/headers, and reading request headers anywhere in a render tree opts the whole route out of the static cache. The component's own doc comment says so: every page that renders the promo "is rendered per request rather than from the static cache". Eight pages render it: the five Christmas question pages, the New Year page, and two Christmas guides.

You can check one page against its neighbour yourself:

curl -sI https://pub-trivia.app/quiz-questions/christmas-music | grep -iE "cache-control|x-vercel-cache|x-nextjs-prerender" curl -sI https://pub-trivia.app/quiz-questions/music | grep -iE "cache-control|x-vercel-cache|x-nextjs-prerender" 

The first answers with cache-control: private, no-cache, no-store, max-age=0, must-revalidate and x-vercel-cache: MISS. The second answers public, max-age=0, must-revalidate, x-nextjs-prerender: 1 and x-vercel-cache: HIT. Same template, same cluster, same author. One has a box on it. Both pages are live at Christmas music questions and music questions, and the promo box on the first one shows a price in your currency, so a VPN to another country is a reasonable second experiment.

Counting every page, not two

Two pages is an anecdote. I took every URL in the sitemap, 141 of them at the time, requested each once and read three headers.

116 public, max-age=0, must-revalidate (prerendered) 25 private, no-cache, no-store (per request) 

The 25 sort cleanly into four causes:

Count Pages Why per request
2 / and /pricing a price in the visitor's currency
8 the promo pages above the same price, in a box
12 /quiz-packs and every pack page under it the same price, on a card
3 /quiz-nights, a town page, a venue page the clock and the database

Twenty-two of the 25 exist because of one decision: a price is shown in the currency of whoever is looking, and that is only known when the request arrives. The other three are the directory, whose pages are only valid "now" and whose search reads query parameters.

I find that grouping more useful than the headline number. There are not 25 problems. There is one trade, made in four places, and one unrelated thing.

Why not make it static anyway

The currency logic's comment explains the alternative that did not win:

Resolving the currency client-side means the page paints "£30", then swaps it for "€36.99" once JavaScript has run. That flicker lands on the single number the visitor came to the page to read. 

So prices are resolved on the server and are right in the first byte. The other common way out is to have the proxy copy the visitor's country into a cookie so the page can be cached per currency. We did not do that either, for a reason that is nothing to do with performance: a preference cookie that the page does not strictly need would contradict the cookie policy on /legal/cookies, which says the site sets only essential cookies, and that claim is why there is no consent banner. A faster page was not worth a banner.

What it costs, measured

Time to first byte, six requests each, from one machine:

christmas-music (per request) 0.50 0.24 0.33 0.26 0.24 0.25 seconds music (prerendered) 0.09 0.12 0.11 0.10 0.10 0.14 seconds 

The median is about a quarter of a second against a tenth. Round that to "150 milliseconds slower" and treat it as one network's view, not a benchmark. Document sizes are within a few kilobytes of each other, 104,134 bytes against 96,832, so this is the cost of rendering on demand and not of sending more.

Is that a good trade? For a page whose job is to show the visitor a price, I think so. For the 116 pages that never show a price, it would be a poor one, and the sweep is how I know none of them have crept into that group. A page that reads a request header cannot be prerendered, so none of the 116 do.

Keeping the cost where it is

Two habits keep it from spreading.

The promo goes after the free content, never before it. The component's own comment says the free page is "the thing people came for". So the question list is in the HTML either way, and the part that needs the visitor's country is the box at the end.

The pure part is a separate function. The component calls getDisplayCurrency(), and that is just visitorCurrency(await headers()). The decision itself, headers in and currency out, takes a plain object, so a test can pass one without a request. Pages get the dynamic cost only by calling the wrapper, and a grep for that one name lists every page that has made the trade.

What I would still change

Reading headers in a Server Component makes the whole route dynamic, but the free question list on those eight pages does not change per visitor. In principle only the box needs to be dynamic, and the rest could be prerendered, with the box streamed in. That is the shape Next.js's newer partial prerendering exists for, and I have not tried it on this site. If I do, the sweep above is the check: the 8 should move from the 25 to the 116, and curl -sI on the Christmas page should stop saying no-store.

Until then there is a way to look at the cost at any time:

curl -s https://pub-trivia.app/sitemap.xml | grep -o '<loc>[^<]*</loc>' | sed 's/<[^>]*>//g' \ | while read u; do printf '%s ' "$(curl -sI "$u" | tr -d '\r' | grep -ic '^x-nextjs-prerender')"; echo "$u"; done 

A 0 is a page rendered for you in particular, and everything that follows it on this page is why.