From 963a41f27ed74ea787798c723e0a35561866f804 Mon Sep 17 00:00:00 2001 From: xing Date: Fri, 23 Sep 2022 21:58:24 +0800 Subject: [PATCH] =?UTF-8?q?favicon=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/cache.go b/middleware/cache.go index 0701f9c..022392c 100644 --- a/middleware/cache.go +++ b/middleware/cache.go @@ -8,7 +8,7 @@ import ( func SetStaticFileCache(c *gin.Context) { f := strings.Split(strings.TrimLeft(c.FullPath(), "/"), "/") - if len(f) > 1 && helper.IsContainInArr(f[0], []string{"wp-includes", "wp-content"}) { + if len(f) > 0 && helper.IsContainInArr(f[0], []string{"wp-includes", "wp-content", "favicon.ico"}) { c.Header("Cache-Control", "private, max-age=86400") } c.Next()