11 lines
239 B
Go
11 lines
239 B
Go
package main
|
|
|
|
import "net/http"
|
|
|
|
func cacheMiddleware(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)
|
|
})
|
|
}
|