Rename "Cache" middleware to "NoCache"

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

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")

View File

@@ -49,7 +49,7 @@ func NewService(opts ...Option) *http.Server {
Handler: alice.New(
middleware.RealIP,
middleware.RequestID,
middleware.Cache,
middleware.NoCache,
middleware.Cors,
middleware.Secure,
middleware.Version(