Roman Matiasko 06084c1d06 initial commit 11 years ago
..
.npmignore 06084c1d06 initial commit 11 years ago
Makefile 06084c1d06 initial commit 11 years ago
Readme.md 06084c1d06 initial commit 11 years ago
index.js 06084c1d06 initial commit 11 years ago
package.json 06084c1d06 initial commit 11 years ago

Readme.md

node-fresh

HTTP response freshness testing

fresh(req, res)

Check freshness of req and res headers.

When the cache is "fresh" true is returned, otherwise false is returned to indicate that the cache is now stale.

Example:

var req = { 'if-none-match': 'tobi' };
var res = { 'etag': 'luna' };
fresh(req, res);
// => false

var req = { 'if-none-match': 'tobi' };
var res = { 'etag': 'tobi' };
fresh(req, res);
// => true

Installation

$ npm install fresh