/cachectl

Primary LanguageJavaScriptApache License 2.0Apache-2.0

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