# browserify-cache

> Easily cache Browserify bundles

Latest version **0.2.1** (published 2012-02-15) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install browserify-cache
pnpm add browserify-cache
yarn add browserify-cache
bun add browserify-cache
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2012-02-15 |
| First published | 2011-11-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.4.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Blake Miner |
| Maintainers | bminer |

## Links

- npm: https://www.npmjs.com/package/browserify-cache
- Repository: https://github.com/bminer/browserify-cache
- npm.io page: https://npm.io/package/browserify-cache

## Recent versions

- 0.2.1 (latest) — 2012-02-15
- 0.2.0 — 2011-12-08
- 0.1.1 — 2011-11-21
- 0.1.0 — 2011-11-18

## README

browserify-cache - Strong and weak caching for Browserify bundles

##Background

"Last-Modified" and "If-Modified-Since" are "weak" caching. If the "If-Modified-Since" header is set, then Browserify can send 304 Not Modified, if appropriate, which saves bandwidth.

"Expires" or "Cache-Control: max-age" are "strong" caching. The browser can simply pull from its own cache in certain cases to save an entire HTTP request.

In the client HTML, your Browserify bundle URL should contain the UNIX timestamp that matches the last modified date of the bundle.

https://github.com/substack/node-browserify

http://code.google.com/speed/page-speed/docs/caching.html

##Usage

```javascript
//Create Express app and config...

//Setup browserify
var browserify = require('browserify');
var browserifyCache = require('browserify-cache');
var browserifyMiddleware = browserify(config.browserify);
app.use(express.browserifyCache(config.browserify, browserifyMiddleware) );

//Now you can expose this URL to your views using Express
app.helpers({
	'browserifyMount': function() {
		return config.browserify.mount + '.' + browserifyMiddleware.modified.getTime() + '.js';
	}
});
```

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