From ca02738962a6afe5750a87b22595547977e4e55c Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Sun, 21 Jul 2019 01:22:24 +0300 Subject: [PATCH] grammar? --- Cache.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Cache.md b/Cache.md index 30fe39c..aca655f 100644 --- a/Cache.md +++ b/Cache.md @@ -1,4 +1,4 @@ -Sometimes is important to cache routes that serve static content to make your web app performs faster and not spend time on re-building a response to the client. +Sometimes is important to cache routes that serve static content to make your web app performs faster and not spend time on re-building a response for clients. There are two ways to achieve HTTP caching. One is to store the contents per handler on the server-side and the other is by checking some headers and send `304 not modified` in order to let the browser or any compatible client to handle the caching by itself. @@ -12,15 +12,13 @@ Let's see their outline. to the next handlers, can be used as: `app.Get("/", iris.Cache, aboutHandler)`. -`Cache` accepts one single parameter: -the cache expiration duration -if the expiration <=2 seconds then expiration is taken by the "cache-control's maxage" header -returns context.Handler. +`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 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 -may fit your needs most. +might fit your needs the most. ```go func Cache(expiration time.Duration) Handler