Increase cache duration, fix bandwidth warning

This commit is contained in:
2021-11-24 11:51:39 +01:00
parent 55f7cf7307
commit 7b5931b963
7 changed files with 21 additions and 17 deletions

View File

@@ -79,9 +79,9 @@ func New(
// Serve static files
var fs = http.FileServer(http.Dir(resourceDir + "/static"))
r.GET(prefix+"/res/*filepath", func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
// Cache resources for 4 weeks
// Cache resources for a year
if !debugMode {
w.Header().Set("Cache-Control", "public, max-age=2419200")
w.Header().Set("Cache-Control", "public, max-age=31536000")
}
r.URL.Path = p.ByName("filepath")
fs.ServeHTTP(w, r)