nocache
    Overview
    Documentation
    Insights
    Code
    Contributors
    Dependencies
    Alternatives

nocache

Middleware to destroy caching

2.1.0  •  Published 7 months ago  •  by helmetjs  •  MIT License

Middleware to turn off caching

Build Status

It’s possible that you’ve got bugs in an old HTML or JavaScript file, and with a cache, some users will be stuck with those old versions. This will (try to) abolish all client-side caching.

const nocache = require('nocache')
app.use(nocache())

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

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

Caching has performance benefits, and you lose them here. It’s also possible that you’ll introduce new bugs and you’ll wish people had old resources cached, but that’s less likely.

How do you feel about the name Devstore for this site?

Popularity

Weekly Downloads
640.6K
Stars
69

Maintenance

Development

Last ver 7 months ago
Created 5 years ago
Last commit 3 months ago
1 month between commits

Technology

Node version: 11.14.0
4.5K unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

4 contributors
Evan Hahn
Maintainer, 62 commits, 4 merges, 2 PRs
Works at Airtable
Michael Kebbekus
1 commits, 1 PRs
Works at Good Eggs
analog-nico
1 commits, 1 PRs
Golo Roden
1 commits
Adam Baldwin
Maintainer
Works at npm
goloroden
1 PRs

Tags

helmet
security
express
connect
nocache
caching
cache
Ready for the next level?
Join Devstore's founding team to help us build the ultimate open-source app store, work with the latest technologies, and enjoy great culture, impact and autonomy
© 2019 Devstore, Inc.
Devstore helps developers find and use open-source packages, so they can focus on building amazing things