Handler like `Cache` but returns an Iris Handler to be used as a middleware. For more options use the `Cache`. Examples can be found at: https://github.com/kataras/iris/tree/main/_examples/response-writer/cache
(expiration time.Duration)
| 87 | // |
| 88 | // Examples can be found at: https://github.com/kataras/iris/tree/main/_examples/response-writer/cache |
| 89 | func Handler(expiration time.Duration) context.Handler { |
| 90 | maxAgeFunc := func(*context.Context) time.Duration { |
| 91 | return expiration |
| 92 | } |
| 93 | |
| 94 | h := Cache(maxAgeFunc).ServeHTTP |
| 95 | return h |
| 96 | } |
searching dependent graphs…