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

Function MaxAge

cache/cache.go:60–64  ·  view source on GitHub ↗

MaxAge is a shortcut to set a simple duration as a MaxAgeFunc. Usage: app.Get("/", cache.Cache(cache.MaxAge(1*time.Minute), mainHandler)

(dur time.Duration)

Source from the content-addressed store, hash-verified

58// Usage:
59// app.Get("/", cache.Cache(cache.MaxAge(1*time.Minute), mainHandler)
60func MaxAge(dur time.Duration) client.MaxAgeFunc {
61 return func(*context.Context) time.Duration {
62 return dur
63 }
64}
65
66// Cache accepts the cache expiration duration.
67// If the "maxAgeFunc" input argument is nil,

Callers 3

TestCacheValidatorFunction · 0.92
NewSignerFunction · 0.85
NewTokenPairMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestCacheValidatorFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…