mirror of
https://github.com/arnaucube/raspberryGPIOhtmlserver.git
synced 2026-02-07 19:56:40 +01:00
32 lines
505 B
Markdown
Executable File
32 lines
505 B
Markdown
Executable File
|
|
# 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:
|
|
|
|
```js
|
|
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
|
|
``` |