MetaTube / route /cache.go
henry99a's picture
Clean commit for Hugging Face Spaces without binary files
ca7217f
package route
import (
"time"
"github.com/gin-gonic/gin"
cachecontrol "go.eigsys.de/gin-cachecontrol/v2"
)
func cachePublicSMaxAge(duration time.Duration) gin.HandlerFunc {
return cachecontrol.New(cachecontrol.Config{
Public: true,
SMaxAge: cachecontrol.Duration(duration),
})
}
func cacheNoStore() gin.HandlerFunc {
return cachecontrol.New(cachecontrol.Config{
// The no-store response directive indicates that any
// caches of any kind (private or shared) should not
// store this response.
NoStore: true,
})
}