Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // NoCache called when a particular handler is not valid for cache. // If this function called inside a handler then the handler is not cached // even if it's surrounded with the Cache/CacheFunc/CacheRemote wrappers. NoCache = client.NoCache )
Functions ¶
func Cache ¶
Cache accepts two parameters first is the context.Handler which you want to cache its result the second is, optional, the cache Entry's expiration duration if the expiration <=2 seconds then expiration is taken by the "cache-control's maxage" header returns context.Handler, which you can use as your default router or per-route handler
All type of responses are cached, templates, json, text, anything.
You can add validators with this function.
func Handler ¶
Handler accepts one single parameter: the cache Entry's expiration duration if the expiration <=2 seconds then expiration is taken by the "cache-control's maxage" header returns context.Handler.
It's the same as Cache and WrapHandler but it sets the "bodyHandler" to the next handler in the chain.
All type of responses are cached, templates, json, text, anything.
it returns a context.Handler, for more options use the .Cache .
func WrapHandler ¶
WrapHandler accepts two parameters first is the context.Handler which you want to cache its result the second is, optional, the cache Entry's expiration duration if the expiration <=2 seconds then expiration is taken by the "cache-control's maxage" header returns context.Handler, which you can use as your default router or per-route handler
All type of responses are cached, templates, json, text, anything.
it returns a context.Handler, for more options use the .Cache .
Types ¶
This section is empty.