cachectl
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i cachectl

Weekly Downloads

2

Version

1.0.2

License

Apache-2.0

Unpacked Size

13.7 kB

Total Files

5

Last publish

Collaborators

  • tombailey