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.
In more detail
It is used on reads: a client that already holds a copy asks whether it is still useful, saving the body when it is. If the tag still matches, the server answers 304 Not Modified with no body; otherwise it sends the new representation.
Example
curl -si localhost:8765/tasks/1 -H 'If-None-Match: "1"'Related terms
- ETag — A response header holding an opaque tag that names one exact version of a representation, such as ETag: "1".
- 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.
- If-Match — The request header that makes a write conditional: the server applies it only if the resource still has the ETag the client sends.
- 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.
Taught in
- HTTP Methods And Status Codes — Modern API Architecture: REST, GraphQL & gRPC
- Caching And Conditional Requests — Modern API Architecture: REST, GraphQL & gRPC
- The Fetch API: Streaming Responses, HTTP Caching And Keepalive — Frontend Architecture & Web Platform