Express req.stale Property

Beginner
⏱️ 8 min read
📚 Updated: May 2026
🎯 4 Code Examples

What you’ll learn

  • What req.stale means in cache revalidation.
  • How to pair req.stale with ETag/Last-Modified headers.
  • How to send full content only when cache is stale.
  • How req.stale differs from req.fresh.

Usage syntax

javascript
req.stale
req.fresh
1

Send content when cache is stale

javascript
app.get('/feed', function (req, res) {
  res.set('ETag', '"feed-v3"');
  if (!req.stale) return res.status(304).end();
  res.json({ updated: true, items: [] });
});
2

Use stale check with Last-Modified

javascript
app.get('/news', function (req, res) {
  res.set('Last-Modified', new Date('2026-05-02').toUTCString());
  if (!req.stale) return res.status(304).end();
  res.send('Fresh news payload');
});

❓ FAQ

It indicates that the cached representation is stale and content should be re-sent.
req.stale is effectively the inverse of req.fresh in conditional request handling.
When validators like ETag or Last-Modified do not satisfy the client's conditional headers.
Yes, especially for GET endpoints that support conditional caching behavior.
Yes. Set ETag/Last-Modified and related headers correctly for predictable results.
Did you know?

req.stale is the opposite of req.fresh; when true, the client cache is not valid and content should be sent.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

4 people found this page helpful