From e927dd2cb09b699df401344bcaf62f961396f48e Mon Sep 17 00:00:00 2001 From: hobokenchicken Date: Mon, 27 Jul 2026 09:16:18 -0400 Subject: [PATCH] fix(server): set no-cache headers on index.html to prevent stale SPA bundles --- cmd/server/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/server/main.go b/cmd/server/main.go index 9ad8ab9..733b092 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -446,9 +446,13 @@ func main() { // If the file exists, serve it; otherwise serve index.html (SPA fallback) path := staticDir + r.URL.Path if _, err := os.Stat(path); os.IsNotExist(err) { + w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") http.ServeFile(w, r, staticDir+"/index.html") return } + if r.URL.Path == "/" || r.URL.Path == "/index.html" { + w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") + } fileServer.ServeHTTP(w, r) }) }