enhanced CDN caching
This commit is contained in:
parent
b312a51c62
commit
dd14b201b1
1 changed files with 2 additions and 2 deletions
4
fs.go
4
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
|
||||
|
|
Loading…
Add table
Reference in a new issue