Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cache-control-midd

dolymood4MIT0.1.1

Express/Connect middleware to set response header cache options

readme

cache-control-midd

Express/Connect middleware to set response header cache options

Install

npm install cache-control-midd --save

Usage

var express = require('express');
var cacheControl = require('cache-control-midd');

var app = express();

// Sets `Cache-Control` header to `public, max-age=600` and `Expires` too
// 'minute' -> 10 minutes -> 600 seconds

app.get('/', cacheControl('minute'), function(req, res) {
    res.send('ok');
});

app.listen(3000, function () {

});

cacheControl(timeValue)

see cache-header-control for details.

Run Tests

npm install
npm test