Socket
Socket
Sign inDemoInstall

cache-control

Package Overview
Dependencies
19
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cache-control

Express/Connect middleware to set url cache options with globs


Version published
Weekly downloads
470
increased by19.59%
Maintainers
2
Install size
1.53 MB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 06 Dec 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc