MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / Cache

Function Cache

middleware/cache.go:7–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5)
6
7func Cache() func(c *gin.Context) {
8 return func(c *gin.Context) {
9 if c.Request.RequestURI == "/" {
10 c.Header("Cache-Control", "no-cache")
11 } else {
12 c.Header("Cache-Control", "max-age=604800") // one week
13 }
14 c.Next()
15 }
16}

Callers 1

SetWebRouterFunction · 0.92

Calls 1

NextMethod · 0.80

Tested by

no test coverage detected