diff --git a/server/index.ts b/server/index.ts index 19a267e..b0451e7 100644 --- a/server/index.ts +++ b/server/index.ts @@ -2936,8 +2936,8 @@ async function serveStatic(path: string, url?: URL): Promise { const headers: Record = { "Content-Type": getContentType(path) }; if (url?.searchParams.has("v")) { headers["Cache-Control"] = "public, max-age=31536000, immutable"; - } else if (path.endsWith(".html")) { - // HTML must revalidate so browsers pick up new hashed JS/CSS references + } else if (path.endsWith(".html") || path === "sw.js" || path === "manifest.json") { + // HTML, service worker, and manifest must revalidate every time headers["Cache-Control"] = "no-cache"; } else if (path.startsWith("assets/")) { // Vite content-hashed assets are safe to cache long-term