Middleware to cache responses.
- Source:
Methods
-
<inner> cache()
-
Middleware to cache server responses and reply them.
This:
- Source:
Returns:
true
if response was retrieved from cache,false
otherwise.
- Type
- boolean
-
<inner> fromCache(req, res)
-
Patches http response to send response from cache, if it is there.
Parameters:
Name Type Description req
object http(s) request
res
object http(s) response
- Source:
Returns:
true
if response is in cache and was patched, otherwisefalse
- Type
- Promise.<boolean>
-
<inner> toCache(req, res)
-
Patches http response to put response to cache.
Parameters:
Name Type Description req
object http(s) request
res
object http(s) response
- Source: