nocache
Middleware to destroy caching
Last updated 6 years ago by evanhahn .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install nocache 
SYNC missed versions from official npm registry.

Middleware to turn off caching

This Express middleware sets some HTTP response headers to try to disable client-side caching.

To use it:

const nocache = require("nocache");

// ...

app.use(nocache());

This sets three headers, disabling a lot of browser caching:

  • Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate
  • Expires: 0
  • Surrogate-Control: no-store

You may wish to do this if you want to ensure that users have up-to-date resources, or if you want to clear out an old version for some reason.

Current Tags

  • 4.0.0                                ...           latest (a year ago)

14 Versions

  • 4.0.0                                ...           a year ago
  • 3.0.4                                ...           2 years ago
  • 3.0.3                                ...           3 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           8 years ago
  • 1.0.1                                ...           8 years ago
  • 1.0.0                                ...           9 years ago
  • 0.4.0                                ...           9 years ago
  • 0.3.0                                ...           10 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (12)

© 2010 - cnpmjs.org x YWFE | Home | YWFE