Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
2.1K
increased by76.52%
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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc