13 lines
243 B
Go
13 lines
243 B
Go
|
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)
|
||
|
})
|
||
|
}
|