Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 28 lines (20 sloc) 0.455 kB
1a8cc33 @tj docs
tj authored
1
2 # fresh(req, res)
3
4 Check freshness of `req` and `res` headers.
5
6 When the cache is "fresh" __true__ is returned,
7 otherwise __false__ is returned to indicate that
8 the cache is now stale.
9
10 ## Example:
11
12 ```js
13 var req = { 'if-none-match': 'tobi' };
14 var res = { 'etag': 'luna' };
15 fresh(req, res);
16 // => false
17
18 var req = { 'if-none-match': 'tobi' };
19 var res = { 'etag': 'tobi' };
20 fresh(req, res);
21 // => true
22 ```
23
24 ## Installation
25
26 ```
27 $ npm install fresh
28 ```
Something went wrong with that request. Please try again.