F3 docs: HTML pages keep Next's own Vary and their ISR caching (measured on the built reference site, both bundlers); the private, no-store Markdown answer is what closes F3

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-12-01 18:01:21 +01:00
co-authored by Claude Opus 5.5
parent 631c583fa3
commit dcf820b365
6 changed files with 9 additions and 7 deletions
+3 -1
View File
@@ -391,7 +391,9 @@ work. The option lets `/md/…` paths through and does the `Accept` negotiation
**The negotiated answer is never cached as the page (1.18.0, security audit F3).** It shares the page's URL, so a
CDN that caches HTML ("Cache Everything" on Cloudflare, Varnish) would otherwise store the Markdown and serve it to
every visitor of that page. The proxy marks the rewritten request, the route answers `private, no-store` with
`Vary: Accept`, the rewrite carries the same headers, and the pages under the proxy matcher get `Vary: Accept`.
`Vary: Accept`, the rewrite carries the same headers. The proxy also asks for `Vary: Accept` on the pages it passes on, but a
Next page answers with Next's own `Vary`: what keeps a shared cache from storing the Markdown as the page is the
`private, no-store` on the Markdown answer.
`/md/…` keeps its public caching. Cloudflare ignores `Vary` for HTML — `no-store` is what keeps it out of the cache
there. Options: `markdown: { prefix: '/ai', negotiate: false }` — `negotiate: false` serves Markdown only at `/md/…`
(no rewrite, no `Vary: Accept` on pages). Verify: