Stop fallback when the allowance ends
04A stale-if-error limit measures time after freshness ends. A later failure beyond that allowance cannot use this example’s fallback.
Origin 500 travels through the cache to the client. No stored 200 is sent and Age is not reset.
Source for this drawing: RFC 5861 · Read RFC section 4.1 ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
- Freshness lifetime
- The interval during which a stored response is fresh, such as max-age=600.
- Staleness
- How far the response is past its freshness lifetime; Age minus 600 in this example.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
Freshness lifetime plus stale allowance sets this example’s outer age bound.
- For max-age=600 and stale-if-error=1200, 600 seconds of freshness plus 1200 seconds of staleness reaches Age 1800. At Age 900, only 300 seconds of the stale allowance have been used.
- The general rule is that a response more stale than the stated limit SHOULD NOT satisfy the request absent other information. Do not turn that qualified SHOULD NOT into an unconditional new MUST.
- The RFC example says to pass the error through after age is greater than 1800 seconds. This scene chooses Age 1801 and assumes no other reuse permission: 1201 seconds stale is beyond the allowance, so the cache forwards the origin’s 500 instead of its stored 200.
The same cached response ages between separate incoming requests: the earlier eligible error case was Age 900; a later request finds Age 1801. It still has max-age=600 and stale-if-error=1200. Crossing the limit does not reset Age or imply the cache was deleted. With another applicable policy the decision must be evaluated again; these examples do not bypass current explicit prohibitions in RFC 9111 §4.2.4.
Read the RFC section ↗