# cache-control

> Express/Connect middleware to set url cache options with globs

Latest version **2.0.0** (published 2016-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install cache-control
pnpm add cache-control
yarn add cache-control
bun add 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 | 2.0.0 |
| Published | 2016-12-06 |
| First published | 2014-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Divshot |
| Maintainers | scottcorgan, mbleigh |
| Keywords | divshot, superstatic, caching, buster |

## Links

- npm: https://www.npmjs.com/package/cache-control
- Repository: https://github.com/divshot/cache-control
- Issues: https://github.com/divshot/cache-control/issues
- npm.io page: https://npm.io/package/cache-control

## Dependencies (8)

- [regular](https://npm.io/package/regular.md) ^0.1.6
- [globject](https://npm.io/package/globject.md) ^1.0.0
- [is-success](https://npm.io/package/is-success.md) ^1.0.0
- [on-headers](https://npm.io/package/on-headers.md) ^1.0.0
- [cache-header](https://npm.io/package/cache-header.md) ^1.0.0
- [glob-slasher](https://npm.io/package/glob-slasher.md) ^1.0.1
- [fast-url-parser](https://npm.io/package/fast-url-parser.md) ^1.0.6-0
- [lodash.isnumber](https://npm.io/package/lodash.isnumber.md) ^2.4.1

## Recent versions

- 2.0.0 (latest) — 2016-12-06
- 1.0.3 — 2014-11-19
- 1.0.2 — 2014-11-18
- 1.0.1 — 2014-11-18
- 1.0.0 — 2014-09-18
- 0.1.1 — 2014-07-25
- 0.1.0 — 2014-07-18

## README

# cache-control

Express/Connect middleware to set url cache options with globs

## Install

```
npm install cache-control --save
```

## Usage

```js
var express = require('express');
var cache = require('cache-control');

var app = express();

app.use(cache({
  '/index.html': 1000,
  '/none/**/*.html': false,
  '/private.html': 'private, max-age=300',
  '/**': 500 // Default to caching all items for 500
}));

app.listen(3000, function () {
  
})
```

### cache(options)

* `options` - an object contain globs as the keys and caching declarations as the values

## Run Tests

```
npm install
npm test
```

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