MCPcopy
hub / github.com/QuantumNous/new-api / Cache

Function Cache

middleware/cache.go:7–17  ·  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.Header("Cache-Version", "b688f2fb5be447c25e5aa3bd063087a83db32a288bf6a4f35f2d8db310e40b14")
15 c.Next()
16 }
17}

Callers 1

SetWebRouterFunction · 0.92

Calls 1

NextMethod · 0.45

Tested by

no test coverage detected