ETag
ResponseActiveAn ETag is an opaque identifier assigned to a specific version of a resource. Clients send the ETag back in If-None-Match requests. If the resource hasn't changed, the server responds with 304 Not Modified without a body – saving bandwidth.
ETag: "<etag_value>" | ETag: W/"<etag_value>"
Description
The ETag (Entity Tag) HTTP response header is an identifier for a specific version of a resource. It lets caches be more efficient and saves bandwidth, as a server does not need to send a full response if the content has not changed.
Directives
| Directive | Description |
|---|---|
| ETag: "33a64df5" | Strong ETag – exact byte-for-byte match required. |
| ETag: W/"33a64df5" | Weak ETag – semantically equivalent, not byte-identical. |
Examples
Response with ETag
http
ETag: "33a64df5551591f46507d2edbb2b1d0d"Conditional GET (client)
http
GET /api/user/42 HTTP/1.1
If-None-Match: "33a64df5551591f46507d2edbb2b1d0d"