Download middleware/disable-cache.go from AZILS/new-api: direct link, hf CLI and curl.
- Browser
- Download file 287 Bytes
-
https://huggingface.co/spaces/AZILS/new-api/resolve/main/middleware/disable-cache.go
- Command line
-
hf download hf://spaces/AZILS/new-api/middleware/disable-cache.go
-
curl -L -o disable-cache.go https://huggingface.co/spaces/AZILS/new-api/resolve/main/middleware/disable-cache.go
287 Bytes
| package middleware | |
| import "github.com/gin-gonic/gin" | |
| func DisableCache() gin.HandlerFunc { | |
| return func(c *gin.Context) { | |
| c.Header("Cache-Control", "no-store, no-cache, must-revalidate, private, max-age=0") | |
| c.Header("Pragma", "no-cache") | |
| c.Header("Expires", "0") | |
| c.Next() | |
| } | |
| } | |