diff --git a/fs.go b/fs.go index 543a60f..d7f7ed6 100644 --- a/fs.go +++ b/fs.go @@ -138,9 +138,9 @@ func ContentTypeHeaderHandler(w http.ResponseWriter, r *http.Request, info Routi } } -// CacheControlHeaderHandler send cache control header of 7 days +// CacheControlHeaderHandler send cache control header of 7 days for the browser and 30 days for the CDN func CacheControlHeaderHandler(w http.ResponseWriter, r *http.Request, info RoutingInfo, file fs.File) { - w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age=%d", 60*60*24*7)) + w.Header().Set("Cache-Control", fmt.Sprintf("public, s-maxage=%d, max-age=%d", 60*60*24*30, 60*60*24*7)) } // ContentTypeOptionHeaderHandler for nosniff content type option