If-None-Match
RequestActiveThe If-None-Match header sends a previously received ETag value back to the server on a conditional GET request. If the resource hasn't changed (ETag matches), the server returns 304 Not Modified with no body – saving bandwidth. If it has changed, the server returns 200 with the new content.
If-None-Match: "<etag>" | *
Description
If-None-Match is the conditional GET mechanism paired with ETag. The browser stores the ETag from a previous response and sends it back on subsequent requests. The server compares the ETag to the current resource – if they match, the resource is unchanged and 304 is returned. This enables efficient cache validation without re-downloading unchanged content.
Directives
| Directive | Description |
|---|---|
| "<etag>" | The ETag value from a previous response. Can be a list of ETags separated by commas. |
| * | Matches any resource. Used to prevent creating a resource that already exists (PUT). |
Examples
Conditional GET
http
GET /api/users HTTP/1.1
If-None-Match: "33a64df5"304 response
http
HTTP/1.1 304 Not Modified
ETag: "33a64df5"
Cache-Control: max-age=3600