From c461afa6798bab76589e35b1bb427f875bd9cd47 Mon Sep 17 00:00:00 2001 From: Jacob Evelyn Date: Thu, 17 Oct 2019 07:50:19 -0400 Subject: [PATCH] Change tracker.js Cache-Control header to no-store According to all documentation I can find, `no-store` is the strongest "do not cache" `Cache-Control` header there is, and `no-cache` and `must-revalidate` are strictly weaker and will have no effect when `no-store` is present. Additionally, I cannot find any evidence that these other values are useful for backwards compatibility or older browsers, and `no-store` support appears to be universal. Lastly, webhint.io is specifically telling me that I should not use `must-revalidate`. --- pkg/api/collect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/collect.go b/pkg/api/collect.go index ebab2ab2..2581ea22 100644 --- a/pkg/api/collect.go +++ b/pkg/api/collect.go @@ -75,7 +75,7 @@ func (c *Collector) ServeHTTP(w http.ResponseWriter, r *http.Request) { // headers to prevent caching w.Header().Set("Content-Type", "image/gif") w.Header().Set("Expires", "Mon, 01 Jan 1990 00:00:00 GMT") - w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") + w.Header().Set("Cache-Control", "no-store") w.Header().Set("Pragma", "no-cache") // response, 1x1 px transparent GIF