From 5dacab2220f281a6b3d930635cd6ded5604cca8a Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Tue, 21 Jan 2020 23:00:34 +0100 Subject: [PATCH] increase cache on static resources --- webcontroller/web_controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webcontroller/web_controller.go b/webcontroller/web_controller.go index 50e62cc..8b13ab4 100644 --- a/webcontroller/web_controller.go +++ b/webcontroller/web_controller.go @@ -54,7 +54,8 @@ func New( // Serve static files var fs = http.FileServer(http.Dir(resourceDir + "/static")) r.GET(p+"/res/*filepath", func(w http.ResponseWriter, r *http.Request, p httprouter.Params) { - w.Header().Set("Cache-Control", "public, max-age=86400") // Cache for one day + // Cache resources for 4 weeks + w.Header().Set("Cache-Control", "public, max-age=2419200") r.URL.Path = p.ByName("filepath") fs.ServeHTTP(w, r) })