From d080cfa058c0e99006cfb2796da5bb0e2b07fe1f Mon Sep 17 00:00:00 2001 From: Marc Ole Bulling Date: Thu, 30 Jan 2025 12:39:15 +0100 Subject: [PATCH] Changed headers for cache control to stop unwanted caching with cloudflare #209 --- internal/webserver/Webserver.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/webserver/Webserver.go b/internal/webserver/Webserver.go index a98bd39..b8b8e5e 100644 --- a/internal/webserver/Webserver.go +++ b/internal/webserver/Webserver.go @@ -767,7 +767,10 @@ func isValidPwCookie(r *http.Request, file models.File) bool { // Adds a header to disable external caching func addNoCacheHeader(w http.ResponseWriter) { - w.Header().Set("cache-control", "no-store") + w.Header().Set("cdn-cache-control", "no-store, no-cache") + w.Header().Set("Cloudflare-CDN-Cache-Control", "no-store, no-cache") + w.Header().Set("cache-control", "no-store, no-cache") + w.Header().Set("Pragma", "no-cache") } // A view containing parameters for a generic template