|
|
11 月之前 | |
|---|---|---|
| .. | ||
| HISTORY.md | 11 月之前 | |
| LICENSE | 11 月之前 | |
| README.md | 11 月之前 | |
| index.js | 11 月之前 | |
| package.json | 11 月之前 | |
HTTP response freshness testing
$ npm install fresh
var fresh = require('fresh')
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