mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 09:57:01 +00:00
replace ioutil with io package and other minor improvements
This commit is contained in:
9
cache/browser.go
vendored
9
cache/browser.go
vendored
@@ -49,10 +49,11 @@ var NoCache = func(ctx *context.Context) {
|
||||
// Usage: `app.Use(cache.StaticCache(24 * time.Hour))` or `app.Use(cache.Staticcache(-1))`.
|
||||
// A middleware, which is a simple Handler can be called inside another handler as well, example:
|
||||
// cacheMiddleware := cache.StaticCache(...)
|
||||
// func(ctx iris.Context){
|
||||
// cacheMiddleware(ctx)
|
||||
// [...]
|
||||
// }
|
||||
//
|
||||
// func(ctx iris.Context){
|
||||
// cacheMiddleware(ctx)
|
||||
// [...]
|
||||
// }
|
||||
var StaticCache = func(cacheDur time.Duration) context.Handler {
|
||||
if int64(cacheDur) <= 0 {
|
||||
return NoCache
|
||||
|
||||
Reference in New Issue
Block a user