nocache

Middleware to destroy caching

MIT 14 个版本
安装
npm install nocache
yarn add nocache
pnpm add nocache
bun add nocache
README

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.

版本列表
4.0.0 2023-06-01
3.0.4 2022-05-21
3.0.3 2022-03-23
3.0.2 2022-03-22
3.0.1 2021-06-22
3.0.0 2021-06-03
2.1.0 2019-05-05
2.0.0 2016-10-28
1.0.1 2016-07-21
1.0.0 2015-12-18
0.4.0 2015-11-01
0.3.0 2015-04-24
0.2.0 2014-12-21
0.1.0 2014-10-28