Rename "Cache" middleware to "NoCache"

This commit is contained in:
Benedikt Kulmann committed 2020-11-16 22:13:26 +01:00
1 parent 31401cdbae
commit aaf9029a3e
8 files changed
+9 -9

No files matched your search

+2 -2
View File
@@ -5,8 +5,8 @@ import (
"time"
)
// Cache writes required cache headers to all requests.
func Cache(next http.Handler) http.Handler {
// NoCache writes required cache headers to all requests.
func NoCache(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate, value")
w.Header().Set("Expires", "Thu, 01 Jan 1970 00:00:00 GMT")