# express-cache-control

> A small middleware library for setting cache control headers

Latest version **1.0.2** (published 2012-11-05) · 0 weekly downloads

## Install

```sh
npm install express-cache-control
pnpm add express-cache-control
yarn add express-cache-control
bun add express-cache-control
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2012-11-05 |
| First published | 2012-05-09 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6.x < 0.9.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Addison Higham |
| Maintainers | addisonj |

## Links

- npm: https://www.npmjs.com/package/express-cache-control
- Repository: github.com/idottv/express-cache-control
- npm.io page: https://npm.io/package/express-cache-control

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md) 1.4.2

## Recent versions

- 1.0.2 (latest) — 2012-11-05
- 1.0.1 — 2012-11-03
- 1.0.0 — 2012-11-03
- 0.0.2 — 2012-06-28
- 0.0.1 — 2012-05-09
- 0.0.0 — 2012-05-09

## README

express-cache-control
=====================

Add caching to your requests in 4 easy steps!


1. Install: `npm install --save express-cache-control`

2. Require: `var CacheControl = require("express-cache-control")`

3. Instantiate: `var cache = new CacheControl().middleware`

4. Mixin it: `app.get("/routetocache", cache("hours", 3), routes.get)`


Other stuff:

- Override caching for development: var cache = new CacheControl({override: 0}).middleware

- The middleware method is bound to the CacheControl instance so you can treat it like a real function `var cache = new CacheControl({override: 0}).middleware`

- leave off the value to assume 1 `cache("hour")`

cache for:
seconds
minutes
hours
days
weeks
months
years




TODO:
Write some tests

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