MCPcopy Index your code
hub / github.com/kataras/iris / Cache

Function Cache

cache/cache.go:77–83  ·  view source on GitHub ↗

Cache accepts the cache expiration duration. If the "maxAgeFunc" input argument is nil, then expiration is taken by the "cache-control's maxage" header. Returns a Handler structure which you can use to customize cache further. All types of response can be cached, templates, json, text, anything. U

(maxAgeFunc client.MaxAgeFunc)

Source from the content-addressed store, hash-verified

75//
76// You can add validators with this function.
77func Cache(maxAgeFunc client.MaxAgeFunc) *client.Handler {
78 if maxAgeFunc == nil {
79 maxAgeFunc = DefaultMaxAge
80 }
81
82 return client.NewHandler(maxAgeFunc)
83}
84
85// Handler like `Cache` but returns an Iris Handler to be used as a middleware.
86// For more options use the `Cache`.

Callers 2

TestCacheValidatorFunction · 0.92
HandlerFunction · 0.70

Calls 1

NewHandlerFunction · 0.92

Tested by 1

TestCacheValidatorFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…