File: connected-users-websocket/node_modules/express/node_modules/fresh/Readme.md

Recommend this page to a friend!
  Classes of Igor Escobar   Terminal Crossword   connected-users-websocket/node_modules/express/node_modules/fresh/Readme.md   Download  
File: connected-users-websocket/node_modules/express/node_modules/fresh/Readme.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Terminal Crossword
Generate a crosswords board on a text console
Author: By
Last change:
Date: 2 years ago
Size: 505 bytes
 

Contents

Class file image Download

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