dremjs-old/apps/Paint/node_modules/express/node_modules/fresh
2018-06-30 01:27:07 -05:00
..
index.js Add files via upload 2018-06-30 01:27:07 -05:00
Makefile Add files via upload 2018-06-30 01:27:07 -05:00
package.json Add files via upload 2018-06-30 01:27:07 -05:00
Readme.md Add files via upload 2018-06-30 01:27:07 -05:00

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