nau 4825f68edf | 8 years ago | |
---|---|---|
.. | ||
.npmignore | 8 years ago | |
Makefile | 8 years ago | |
Readme.md | 8 years ago | |
index.js | 8 years ago | |
package.json | 8 years ago |
HTTP response freshness testing
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.
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
$ npm install fresh