Increase cache duration, fix bandwidth warning

This commit is contained in:
Pixeldrain-Server committed 2021-11-24 11:51:39 +01:00
1 parent 55f7cf7307
commit 7b5931b963
7 files changed
+21 -17

No files matched your search

+2 -2
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)