mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
minor
parent
ca02738962
commit
541724e6fa
3
Cache.md
3
Cache.md
|
@ -11,14 +11,13 @@ Let's see their outline.
|
||||||
`Cache` is a middleware that provides server-side cache functionality
|
`Cache` is a middleware that provides server-side cache functionality
|
||||||
to the next handlers, can be used as: `app.Get("/", iris.Cache, aboutHandler)`.
|
to the next handlers, can be used as: `app.Get("/", iris.Cache, aboutHandler)`.
|
||||||
|
|
||||||
|
|
||||||
`Cache` accepts one single parameter: the cache expiration duration.
|
`Cache` accepts one single parameter: the cache expiration duration.
|
||||||
If the expiration is invalid value, <=2 seconds, then expiration is taken by the "cache-control's maxage" header
|
If the expiration is invalid value, <=2 seconds, then expiration is taken by the "cache-control's maxage" header
|
||||||
|
|
||||||
All types of response can be cached, templates, json, text, anything.
|
All types of response can be cached, templates, json, text, anything.
|
||||||
|
|
||||||
Use it for server-side caching, see the `Cache304` for an alternative approach that
|
Use it for server-side caching, see the `Cache304` for an alternative approach that
|
||||||
might fit your needs the most.
|
may be more suited to your needs.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func Cache(expiration time.Duration) Handler
|
func Cache(expiration time.Duration) Handler
|
||||||
|
|
Loading…
Reference in New Issue
Block a user