You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
505 B

  1. # node-fresh
  2. HTTP response freshness testing
  3. ## fresh(req, res)
  4. Check freshness of `req` and `res` headers.
  5. When the cache is "fresh" __true__ is returned,
  6. otherwise __false__ is returned to indicate that
  7. the cache is now stale.
  8. ## Example:
  9. ```js
  10. var req = { 'if-none-match': 'tobi' };
  11. var res = { 'etag': 'luna' };
  12. fresh(req, res);
  13. // => false
  14. var req = { 'if-none-match': 'tobi' };
  15. var res = { 'etag': 'tobi' };
  16. fresh(req, res);
  17. // => true
  18. ```
  19. ## Installation
  20. ```
  21. $ npm install fresh
  22. ```