hackcentercontrol/nodeartnet/node_modules/express/node_modules/fresh
Lucas Pleß 6e49f004cd initial commit 2012-12-28 23:17:47 +01:00
..
.npmignore initial commit 2012-12-28 23:17:47 +01:00
Makefile initial commit 2012-12-28 23:17:47 +01:00
Readme.md initial commit 2012-12-28 23:17:47 +01:00
index.js initial commit 2012-12-28 23:17:47 +01:00
package.json initial commit 2012-12-28 23:17:47 +01:00

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