1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-05 11:17:03 +00:00

Fix httpcache sub-package.

Former-commit-id: d0bf86713bda90ade130c93dcf04d9b26f1e4f08
This commit is contained in:
esemplastic
2017-04-12 00:56:57 +03:00
committed by Gerasimos (Makis) Maropoulos
parent 2d3bd55dd5
commit 3e5f61ff6b
4 changed files with 36 additions and 8 deletions

View File

@@ -722,10 +722,6 @@ func (c *cachedMuxEntry) Serve(ctx *Context) {
// ctx.WriteString("Hello, world!") // or a template or anything else
// }, time.Duration(10*time.Second))) // duration of expiration
// if <=time.Second then it tries to find it though request header's "cache-control" maxage value
//
// Note that it depends on a station instance's cache service.
// Do not try to call it from default' station if you use the form of app := iris.New(),
// use the app.Cache instead of iris.Cache
func (s *Framework) Cache(bodyHandler HandlerFunc, expiration time.Duration) HandlerFunc {
ce := newCachedMuxEntry(s, bodyHandler, expiration)
return ce.Serve