cache-control
Version:
Express/Connect middleware to set url cache options with globs
41 lines (27 loc) • 610 B
Markdown
set url cache options with globs
```
npm install cache-control --save
```
```js
var express = require('express');
var cache = require('cache-control');
var app = express();
app.use(cache({
'/index.html': 1000,
'/none/**/*.html': false,
'/private.html': 'private, max-age=300',
'/**': 500 // Default to caching all items for 500
}));
app.listen(3000, function () {
})
```
* `options` - an object contain globs as the keys and caching declarations as the values
```
npm install
npm test
```
Express/Connect middleware to