mirror of https://github.com/synctv-org/synctv
parent
871310e4f1
commit
cb3d03bb31
@ -1,14 +0,0 @@
|
||||
package middlewares
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func NewDistCacheControl(prefix string) gin.HandlerFunc {
|
||||
return func(ctx *gin.Context) {
|
||||
if ctx.Request.URL.Path == prefix {
|
||||
ctx.Header("Cache-Control", "no-cache, max-age=300")
|
||||
} else {
|
||||
ctx.Header("Cache-Control", "public, max-age=31536000")
|
||||
}
|
||||
ctx.Next()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue