1.0.2 • Published 2 years ago

cachectl v1.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

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.

License

Apache License Version 2.0