From 3b8ac54e3863aff30d229e4fb4b9b80c9c5e731b Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Sat, 6 Jul 2024 20:26:24 +0800 Subject: [PATCH] Add cache control headers for root path (#488) --- api/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/main.go b/api/main.go index 2a2d5c83..dd85ed17 100644 --- a/api/main.go +++ b/api/main.go @@ -197,6 +197,10 @@ func main() { w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") w.Header().Set("Pragma", "no-cache") w.Header().Set("Expires", "0") + } else if r.URL.Path == "/" { + w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") + w.Header().Set("Pragma", "no-cache") + w.Header().Set("Expires", "0") } fs.ServeHTTP(w, r) })