In Express.js, req.stale is a Boolean that is true when the client’s cached copy is not considered fresh. Officially it is the opposite of req.fresh: req.stale === !req.fresh.
Use it for conditional GET/HEAD responses. When stale, send the full body (200). When fresh (!req.stale), send 304 Not Modified. Express compares If-None-Match / If-Modified-Since to your ETag / Last-Modified response headers.
Syntax
Read req.stale in your Express.js route handler. Start with this line.
Express
req.stale // Boolean — opposite of req.fresh
req.fresh // Boolean — client cache still valid
if (!req.stale) return res.status(304).end();
res.send(body);
Call
What it does
req.stale // Boolean — opposite of req.fresh
Primary signature.
req.fresh // Boolean — client cache still valid
Related call form.
if (!req.stale) return res.status(304).end();
Related call form.
res.send(body);
Related call form.
Install with npm install express. Create the app with const app = express() before you use this API in an Express.js tutorial project.
Library declarations
Express
const express = require("express");
const app = express();
req.stale // Boolean — opposite of req.fresh
req.fresh // Boolean — client cache still valid
if (!req.stale) return res.status(304).end();
res.send(body);
Parameters
This Express.js property is read from the request or response — it has no call parameters.
Return Value
req.stale is a Boolean property — the inverse of req.fresh. When the cache validators do not match, it is true.
GET /news
→ 200 Fresh news payload
Last-Modified: Sat, 02 May 2026 00:00:00 GMT
GET /news (If-Modified-Since: Sat, 02 May 2026 00:00:00 GMT)
→ req.fresh === true → req.stale === false
→ 304 Not Modified
How It Works
Advertise mtime.Last-Modified tells caches when the resource last changed.
Client revalidates. Browsers send If-Modified-Since on later visits.
Use either flag.if (req.fresh) is the same decision as if (!req.stale).
Send only when needed. Stale requests get the full string body.
Example 3 — Let res.send Apply Freshness
Express helpers can emit 304 automatically when the request is fresh.
Express
const express = require('express');
const app = express();
app.get('/page', (req, res) => {
res.set('ETag', '"page-1"');
// If req.fresh, res.send turns this into 304 with an empty body
res.send('Hello, cached world');
});
app.listen(3000);
Output
GET /page
→ 200 Hello, cached world
GET /page (If-None-Match: "page-1")
→ 304 Not Modified (body omitted by Express)
How It Works
Still set ETag. Without validators, every request stays stale.
res.send checks freshness. Internally it looks at req.fresh before writing the body.
Fresh → 304. Matching If-None-Match skips the body.
Explicit checks optional. Use manual req.stale when you need custom branching; otherwise res.send / res.json is enough.
Compatibility
Runtime Support
req.stale is an Express.js request property. It runs on a Node.js server (Express 5 needs Node.js 18+). Browsers send conditional headers; they do not expose req.stale.
✓ Server · Express 4 & 5
req.stale
Works wherever Express runs: Node.js is the primary target. Bun and Deno can run many Express apps with compatibility layers. Not available in the browser.
ServerNode.js runtime API
Node.js18+ for Express 5 · 14+ typical for Express 4
Supported
BunExpress-compatible server apps
Supported
DenoVia npm compatibility / adapters
Supported
req.staleExpress on Node.js
Bottom line: Study and run these examples with Node.js and the express package. Copy a snippet into a local file and start the server with node.
Frequently Asked Questions
It is a Boolean that is true when the client’s cached copy is not considered fresh. Officially it is the opposite of req.fresh — when stale, send the full response.
req.stale is always !req.fresh. If the cache is still valid (fresh), send 304 Not Modified; if stale, send 200 with the body.
Express computes freshness by comparing request validators (If-None-Match / If-Modified-Since) to response headers already set on res. Set those headers before reading req.stale.
Yes. When you call res.send (and related helpers) with matching validators, Express can turn a fresh request into a 304 without an explicit check.
No. It is a server-side Express property. Browsers send conditional headers; your server decides 304 vs full body.