req.fresh

req.fresh

Indicates whether the request is “fresh.” It is the opposite of req.stale.

It is true if the cache-control request header doesn’t have a no-cache directive and any of the following are true:

  • The if-modified-since request header is specified and last-modified request header is equal to or earlier than the modified response header.
  • The if-none-match request header is *.
  • The if-none-match request header, after being parsed into its directives, does not match the etag response header.
req.fresh
// => true

For more information, issues, or concerns, see fresh.

doc_Express
2016-05-02 16:34:46
Comments
Leave a Comment

Please login to continue.