DFS_Shuo_Chen e2eb47a926 V1.16.9 11 ماه پیش
..
HISTORY.md e2eb47a926 V1.16.9 11 ماه پیش
LICENSE e2eb47a926 V1.16.9 11 ماه پیش
README.md e2eb47a926 V1.16.9 11 ماه پیش
index.js e2eb47a926 V1.16.9 11 ماه پیش
package.json e2eb47a926 V1.16.9 11 ماه پیش

README.md

fresh

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

HTTP response freshness testing

Installation

$ npm install fresh

API

var fresh = require('fresh')

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

License

MIT