www-jmbit-de/internal/middlewares/caching.go

13 lines
243 B
Go
Raw Permalink Normal View History

package middlewares
import (
"net/http"
)
func Caching(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "max-age=3600")
next.ServeHTTP(w, r)
})
}