From f1b1329c1bffeda69a1f92a6f205f4aed3b6bcdd Mon Sep 17 00:00:00 2001 From: BOHA Date: Wed, 10 Jun 2026 20:34:31 +0200 Subject: [PATCH] fix(spa): cacheControl:false so custom cache headers actually apply @fastify/static's default Cache-Control management overwrote the setHeaders values with 'public, max-age=0' (verified on prod after the v2.4.8 deploy) - the README requires disabling it for custom headers. Co-Authored-By: Claude Fable 5 --- src/server.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server.ts b/src/server.ts index 3ece061..8698e5e 100644 --- a/src/server.ts +++ b/src/server.ts @@ -206,6 +206,11 @@ async function start() { root: path.join(__dirname, "..", "dist-client"), prefix: "/", wildcard: false, + // The plugin's own Cache-Control management must be OFF or it + // overwrites the setHeaders values below with "public, max-age=0" + // (README: "To provide a custom Cache-Control header, set this option + // to false"). ETags stay on, so no-cache still revalidates cheaply. + cacheControl: false, // Deploy-skew caching contract (per the Vite deploy guide): // - /assets/* names are content-hashed → safe to cache forever // (a changed file always gets a NEW name, so "immutable" is correct).