April 2018
Intermediate to advanced
178 pages
3h 51m
English
Let's install it with the NPM package manager; once again, we will install it globally and make use of the -s option, which will update the package.json file with the new express-cache-control dependency automatically:
npm install -g -s express-cache-control
Enabling caching with the express-cache-control middleware requires three straightforward steps:
CacheControl = require("express-cache-control")
var cache = new CacheControl().middleware;
router.get('/v2/', cache('minutes', 1), function(request, response) { var getParams = url.parse(request.url, ...