From 43347bc31b33d7804a1f4efd83f579125d5ff6c5 Mon Sep 17 00:00:00 2001 From: Oleg Date: Fri, 31 Jul 2026 22:10:10 +0000 Subject: [PATCH] Send Cache-Control: no-store on every page to defeat upstream caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every page here is personalized (session, coin balance, owned games) — no intermediate proxy should ever cache one. Traced a report of a stale UI (missing header content that had already shipped) to caching somewhere between the app and the client — nginx isn't even on this VM, the user's reverse proxy (Nginx Proxy Manager) lives on a separate one I can't inspect. Rather than debug an opaque hop I don't control, close it from this side: explicit no-store on every HTML/API response except /_next/static, which keeps its normal long-lived immutable caching since those filenames are content-hashed by the build. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01QcXH24ky6zjk2UyK5oZUPH --- next.config.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/next.config.ts b/next.config.ts index e0dc503..87d3562 100644 --- a/next.config.ts +++ b/next.config.ts @@ -5,6 +5,20 @@ const nextConfig: NextConfig = { // native .node binaries, not its JS loader, causing a segfault in // production. Deploying with the full node_modules via `next start` is // simple enough for a single-VM deployment. + + async headers() { + return [ + { + // Every page is personalized (session, wallet balance, owned + // games) — an intermediate proxy (nginx, a CDN) has no business + // caching any of it. Static assets under /_next/static are + // content-hashed by the build and are explicitly excluded here so + // they keep their own long-lived caching. + source: "/((?!_next/static).*)", + headers: [{ key: "Cache-Control", value: "no-store" }], + }, + ]; + }, }; export default nextConfig;