cache-control

Express/Connect middleware to set url cache options with globs

MIT 7 个版本
安装
npm install cache-control
yarn add cache-control
pnpm add cache-control
bun add cache-control
README

cache-control

Express/Connect middleware to set url cache options with globs

Install

npm install cache-control --save

Usage

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 () {
  
})

cache(options)

  • options - an object contain globs as the keys and caching declarations as the values

Run Tests

npm install
npm test
版本列表
2.0.0 2016-12-06
1.0.3 2014-11-19
1.0.2 2014-11-18
1.0.1 2014-11-18
1.0.0 2014-09-18
0.1.1 2014-07-25
0.1.0 2014-07-18