goveal/api/no_cache_middleware.go

12 lines
264 B
Go

package api
import (
"net/http"
)
func NoCache(handler http.Handler) http.Handler {
return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
writer.Header().Set("Cache-Control", "no-cache")
handler.ServeHTTP(writer, request)
})
}