From f5211b0697a711b5e6aa133b393698ba06111c9f Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 27 Apr 2015 09:08:55 +0200 Subject: [PATCH] Add some more cache forbidding headers, for various user agents. --- cmd/syncthing/gui.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index e57a1a2c..c9847bc6 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -256,7 +256,9 @@ func redirectToHTTPSMiddleware(h http.Handler) http.Handler { func noCacheMiddleware(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "no-cache") + w.Header().Set("Cache-Control", "max-age=0, no-cache, no-store") + w.Header().Set("Expires", time.Now().UTC().Format(http.TimeFormat)) + w.Header().Set("Pragma", "no-cache") h.ServeHTTP(w, r) }) }