mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
fix: added cache on static files
This commit is contained in:
@@ -81,6 +81,7 @@ func StaticFileServerWithContentType(fsys http.FileSystem) http.Handler {
|
||||
path := r.URL.Path
|
||||
if ext := filepath.Ext(path); ext != "" {
|
||||
if ct, ok := contentTypes[ext]; ok {
|
||||
w.Header().Set("Cache-Control", "public, max-age=31536000")
|
||||
w.Header().Set("Content-Type", ct)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user