Strong ETag
A strong ETag guarantees that two resources with the same ETag are byte-for-byte identical. Any change—even a single byte—requires a new ETag. Format: "abc123"
Full Explanation
A strong ETag is a validator that guarantees byte-for-byte identity between two representations of a resource. If two responses carry the same strong ETag, they are identical down to the last byte. The format is a quoted string in the ETag response header, like ETag: "5d8c72a5edda8". Any change to the resource, no matter how small, must produce a different ETag value.
Strong ETags power conditional requests. When your browser first fetches a resource, it stores the ETag. On the next request for the same URL, it sends If-None-Match: "5d8c72a5edda8". If the resource has not changed, the server responds with 304 Not Modified and an empty body, saving bandwidth and time. If the resource changed, the server sends the full response with a new ETag.
This is especially useful for static assets like images, JavaScript bundles, and CSS files where byte-level identity matters. Strong ETags can also be used for byte-range requests (resumable downloads), which is something weak ETags cannot do.
// First request
GET /static/app.js HTTP/1.1
Host: cdn.example.com
// First response
HTTP/1.1 200 OK
ETag: "a1b2c3d4e5f6"
Content-Length: 48293
Cache-Control: max-age=3600
// Subsequent request (browser sends stored ETag)
GET /static/app.js HTTP/1.1
Host: cdn.example.com
If-None-Match: "a1b2c3d4e5f6"
// Response when unchanged
HTTP/1.1 304 Not Modified
ETag: "a1b2c3d4e5f6"
Interactive Animation
Examples
Nginx generates strong ETags automatically for static files based on the last-modified time and content length. You can also compute them from a hash of the file contents for even stronger guarantees.
# Check ETag behavior with curl
curl -I https://cdn.example.com/style.css
# ETag: "6523af7c-1a4f"
# Conditional request
curl -H 'If-None-Match: "6523af7c-1a4f"' -I https://cdn.example.com/style.css
# HTTP/1.1 304 Not Modified
Frequently Asked Questions
A strong ETag guarantees that two resources with the same ETag are byte-for-byte identical. Any change—even a single byte—requires a new ETag. Format: "abc123"
Nginx generates strong ETags automatically for static files based on the last-modified time and content length. You can also compute them from a hash of the file contents for even stronger guarantees.
# Check ETag behavior with curl
curl -I https://cdn.example.com/style.css
# ETag: "6523af7c-1a4f"
# Conditional request
curl -H 'If-None-Match: "6523af7c-1a4f"' -I https://cdn.example.com/style.css
# HTTP/1.1 304 Not Modified