From adcd6fc08a45a7c39c43c59bbb55080e691712df Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Wed, 22 May 2024 14:14:04 +0200 Subject: [PATCH] fix: added cache on static files --- api/page.go | 1 + 1 file changed, 1 insertion(+) diff --git a/api/page.go b/api/page.go index 27e1ddd..e6f43cd 100644 --- a/api/page.go +++ b/api/page.go @@ -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) } }