Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 665 Bytes

README.md

File metadata and controls

41 lines (31 loc) · 665 Bytes

connect-expires

expire middlewae for connect(express)

How to use

var expires = require('/path/to/connect-expires')
  ;

// ...
app.use(expires({
  pattern: /^(?:\/dist\/combine|\/img\/)/,
  duration: 1000 * 60 * 60 * 24 * 15
}));
app.use(express.static(path.join(__dirname, 'public')));
// ...

install connect-expires via npm first:

npm install connect-expires

and then include it in your project with:

var expires = require('connect-expires');

option

  • pattern
    • Patterns of files that adapt
    • Type: RegExp
  • duration
    • Period to adapt the Expires
    • Type: Number (ms)
    • default: one day