Changed headers for cache control to stop unwanted caching with cloudflare #209

This commit is contained in:
Marc Ole Bulling
2025-01-30 12:39:15 +01:00
parent 4bf5b7c688
commit d080cfa058

View File

@@ -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