From 4568af95423314f7354170fb43b08dc36839c3be Mon Sep 17 00:00:00 2001 From: BoYanZh Date: Mon, 19 Dec 2022 13:32:00 +0800 Subject: [PATCH] feat: better static file Cache-Control (#2751) --- server/static/static.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/static/static.go b/server/static/static.go index adfac1ba..82a461ae 100644 --- a/server/static/static.go +++ b/server/static/static.go @@ -68,7 +68,7 @@ func Static(r *gin.Engine) { r.Use(func(c *gin.Context) { for i := range folders { if strings.HasPrefix(c.Request.RequestURI, fmt.Sprintf("/%s/", folders[i])) { - c.Header("Cache-Control", "max-age=86400") + c.Header("Cache-Control", "public, max-age=15552000") } } })