Why did adding CSP nonces change your HTML caching policy?
After this you can answer: Why did adding CSP nonces change your HTML caching policy?
Say it in 30 seconds
Section titled “Say it in 30 seconds”The deeper answer
Section titled “The deeper answer”A Content Security Policy tells the browser which content may execute. The proxy overwrites caller-provided nonce and policy headers before forwarding the request, so Next.js can apply the server-generated nonce to its scripts. It also puts the matching policy on the response.
The proxy covers HTML and React Server Component routes while excluding static assets and selected server endpoints. Both it and Next.js headers enforce no-store for the relevant responses. The optional CloudFront events cache configuration therefore does not mean that event HTML is currently stored at the edge.
Public event data can still be cached separately, and hashed static asset URLs can retain their own policy. This distinction matters: disabling shared HTML caching is not the same as removing every useful cache. CSP reduces the impact of some script injection paths, but a trusted script with a bug or hostile runtime data still needs secure application code.
Counter-questions
Section titled “Counter-questions”What if the nonce in HTML differs from the header?
Does strict-dynamic make trusted scripts harmless?
Would removing the nonce improve performance?
Where in MiniTickets
Section titled “Where in MiniTickets”Read Security headers, then inspect the web-app piece →.
apps/web/src/proxy.ts → proxyRead this book online: https://book.theversehub.in/