# connect-guard

> Connect middleware that short circuits request handling if it can send a 304 Not Modified response. Intended to be used with reverse proxies like Varnish.

Latest version **0.2.0** (published 2015-05-22) · 0 weekly downloads

## Install

```sh
npm install connect-guard
pnpm add connect-guard
yarn add connect-guard
bun add connect-guard
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-05-22 |
| First published | 2013-06-25 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | asalant, hurrymaplelad, goodeggs, demands, sherrman, randypuro |
| Keywords | connect, cache, proxy, cache-control, etag, last-modified, varnish |

## Links

- npm: https://www.npmjs.com/package/connect-guard
- Repository: https://github.com/goodeggs/connect-guard
- Homepage: http://goodeggs.github.com/connect-guard/
- Issues: https://github.com/goodeggs/connect-guard/issues
- npm.io page: https://npm.io/package/connect-guard

## Dependencies (2)

- [fresh](https://npm.io/package/fresh.md) *
- [on-headers](https://npm.io/package/on-headers.md) 1

## 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

- 0.2.0 (latest) — 2015-05-22
- 0.1.2 — 2014-02-12
- 0.1.1 — 2014-02-01
- 0.0.6 — 2013-08-15
- 0.0.5 — 2013-08-09
- 0.0.4 — 2013-08-01
- 0.0.3 — 2013-06-30
- 0.0.2 — 2013-06-29
- 0.0.1 — 2013-06-25

## README

Guard [![NPM version](https://badge.fury.io/js/connect-guard.png)](http://badge.fury.io/js/connect-guard) [![Build Status](https://travis-ci.org/goodeggs/connect-guard.png)](https://travis-ci.org/goodeggs/connect-guard)
============

Guard is connect middleware that short circuits request handling if it can send a 304 Not Modified response.
Intended to be used with reverse proxies like Varnish.

Status
------------

Work in-progress. Hold off for a bit.

Stores
------
Guard can store request and response information wherever you like.  In memory is the default.  If your site hosts lots of unique URLs, a DB is probably a better choice.  Choose one of the following stores, or [write your own](docs/writing_a_store.md).

- [MemoryStore](src/memory_store.coffee) - the default
- [MongoGuardStore](https://github.com/goodeggs/mongo-guard-store) - backed by MongoDB

Contributing
-------------

```
$ git clone https://github.com/goodeggs/connect-guard && cd connect-guard
$ npm install
$ npm test
```

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