req.fresh
A flag indicating that the user-agent sending this request (req
) wants "fresh" data (as indicated by the "if-none-match", "cache-control", and/or "if-modified-since" request headers.)
If the request wants "fresh" data, usually you'll want to .find()
fresh data from your models and send it back to the client.
req.fresh;
if (req.fresh) {
// The user-agent is asking for a more up-to-date version of the requested resource.
// Let's hit the database to get some stuff and send it back.
}
- See the
node-fresh
module for details specific to the implementation in Sails/Express/Koa/Connect.