nodePong/node_modules/express/node_modules/fresh
frtk edd511b402 version 0.0.1 - HTTP & SocketIo services on server 2016-02-10 10:36:00 +01:00
..
HISTORY.md version 0.0.1 - HTTP & SocketIo services on server 2016-02-10 10:36:00 +01:00
LICENSE version 0.0.1 - HTTP & SocketIo services on server 2016-02-10 10:36:00 +01:00
README.md version 0.0.1 - HTTP & SocketIo services on server 2016-02-10 10:36:00 +01:00
index.js version 0.0.1 - HTTP & SocketIo services on server 2016-02-10 10:36:00 +01:00
package.json version 0.0.1 - HTTP & SocketIo services on server 2016-02-10 10:36:00 +01:00

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