freshness
Whether a cached response may still be used without asking the server: fresh means yes, stale means it must be checked or fetched again.
In more detail
The server sets the fresh lifetime, usually with max-age. Freshness avoids a request altogether, while validation still makes a request but can avoid resending the body.
Example
In the browser: HTTP caches judge freshness from Cache-Control max-age; service worker strategies decide it in code.Related terms
- max-age — The Cache-Control directive that says how many seconds a stored response stays fresh.
- cache validation — Asking the server whether a stored response is still current by sending back its validator, such as an ETag, in a conditional request.
- HTTP cache — A store that keeps HTTP responses and reuses them for later requests, following the rules the server sends in Cache-Control.
- Cache-Control — The HTTP header that states the caching policy for a response, such as private, max-age=0 or no-store.
- stale-while-revalidate — A caching strategy that answers immediately from the cache, even if out of date, while fetching a fresh copy in the background for next time.
Taught in
- Caching And Conditional Requests — Modern API Architecture: REST, GraphQL & gRPC
- Webhooks Versus Polling — Modern API Architecture: REST, GraphQL & gRPC
- Cache Storage API: Offline Strategies And Cache-First Patterns — Frontend Architecture & Web Platform
- The Fetch API: Streaming Responses, HTTP Caching And Keepalive — Frontend Architecture & Web Platform