Have cache_handler overwrite any previous cache-control headers
@@ -11,7 +11,7 @@ const yearInSeconds = 31536000
func CacheNearlyForever(handler http.Handler) http.Handler {
withoutGz := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Header().Add("Cache-Control", fmt.Sprintf("max-age=%d, private", yearInSeconds))
+ w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%d, private", yearInSeconds))
handler.ServeHTTP(w, r)
})
return gziphandler.GzipHandler(withoutGz)
