favicon缓存

This commit is contained in:
xing 2022-09-23 21:58:24 +08:00
parent 13e3b4804e
commit 963a41f27e

View File

@ -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()