feat: better static file Cache-Control (#2751)

pull/2759/head
BoYanZh 2022-12-19 13:32:00 +08:00 committed by GitHub
parent b50d486a63
commit 4568af9542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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")
}
}
})