From f95696802a5589fa5cb1f524bed6fc28c4544c55 Mon Sep 17 00:00:00 2001 From: DmytroMaslov Date: Mon, 23 Dec 2024 16:16:28 +0200 Subject: [PATCH] fix: make page in admin panel uncacheble --- main_handler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main_handler.go b/main_handler.go index e17bef0e..f99c5507 100644 --- a/main_handler.go +++ b/main_handler.go @@ -22,6 +22,10 @@ func mainHandler(w http.ResponseWriter, r *http.Request) { pageErrorHandler(w, r, nil) return } + + w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate, private") + w.Header().Set("Expires", "0") + r.URL.Path = strings.TrimPrefix(r.URL.Path, RootURL) r.URL.Path = strings.TrimSuffix(r.URL.Path, "/") URLParts := strings.Split(r.URL.Path, "/")