cachectl
v1.0.2
Published
Creates Cache-Control headers
Downloads
10
Maintainers
Readme
cachectl
Create cache control headers for express and elsewhere.
Installation
npm install --save cachectl
Usage
const cachectl = require('cachectl');
const express = require('express');
const app = express();
app.get('/data', (req, res) => {
res.header(cachectl.public().maxAge(60 * 60)).json({ data: 'cached for 1 hour' })
});
app.listen(8080);
See examples for more usage scenarios.