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.
In more detail
If nothing changed, the server answers 304 Not Modified with no body and the client keeps its copy; if it changed, the client gets a normal 200 with the new representation. A missing validator is a correctness bug as well as a speed bug, because it also makes safe conditional updates impossible.
Related terms
- ETag — A response header holding an opaque tag that names one exact version of a representation, such as ETag: "1".
- If-None-Match — The request header that sends back an ETag and asks the server to answer 304 Not Modified if that version is still current.
- 304 Not Modified — The HTTP status answering a conditional GET to say the copy the client already has is still current, so no body is sent.
- conditional request — An HTTP request that the server carries out only if a condition in its headers is true, such as If-None-Match or If-Match.
- Cache-Control — The HTTP header that states the caching policy for a response, such as private, max-age=0 or no-store.
Taught in
- Caching And Conditional Requests — 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