Files
learn-file-storage-s3-golan…/cache.go
Daniel Hjartland 75be79c6cf initial commit
2025-01-02 16:32:57 +01:00

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)
})
}