package
Get and set the response cache header
npm install cache-headerGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
3 direct · 2 outdated
Get and set the response cache header
npm install cache-header --savevar express = require('express');
var cacheHeader = require('cache-header');
var app = express();
app.use(function (req, res, next) {
// Sets Cache-Control header to public, max-age=10000
cacheHeader(res, 10000);
next();
});
app.listen(3000, function () {
});responseObject - the response object passed through by NodeheaderValue - value to set the header to. Can be the following types:
false - sets value to no-cachenumber - a number or a parseable string. Sets header to public, max-age={number}string - sets the header to whatever the string isnpm install
npm test