You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

cache-control

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cache-control

Express/Connect middleware to set url cache options with globs

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
555
6.12%
Maintainers
2
Weekly downloads
 
Created
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

divshot

FAQs

Package last updated on 06 Dec 2016

Did you know?

Socket

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