goveal/api/no_cache_middleware.go

13 lines
264 B
Go
Raw Normal View History

package api
2022-03-15 13:53:24 +00:00
import (
"net/http"
)
2022-03-15 13:53:24 +00:00
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)
})
}