Skip to content

HTTPS clone URL

Subversion checkout URL

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