# nocache

> Middleware to destroy caching

Latest version **4.0.0** (published 2023-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install nocache
pnpm add nocache
yarn add nocache
bun add nocache
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2023-06-01 |
| First published | 2014-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 142 |
| Author | Adam Baldwin |
| Maintainers | evanhahn |
| Keywords | express, connect, nocache, caching, cache |

## Links

- npm: https://www.npmjs.com/package/nocache
- Repository: https://github.com/helmetjs/nocache
- Issues: https://github.com/helmetjs/nocache/issues
- npm.io page: https://npm.io/package/nocache

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 4.0.0 (latest) — 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

## README

# Middleware to turn off caching

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

To use it:

```javascript
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.

---
_Source: https://npm.io/package/nocache · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
