← All headersResponse header

What is an ETag header?

An opaque identifier for a specific version of a resource, used for cache validation and conditional requests.

ETag gives a website a fingerprint for the exact version of a resource, which browsers and caches use with If-None-Match to check 'has this actually changed?' without re-downloading the whole thing if it hasn't. A correctly implemented ETag setup is one of the more reliable ways to validate that a site's caching is working as intended - if ETags never change even after a real content update, that's a strong sign the caching layer is stale.

Common use case

A REST API generates an ETag from a hash of the resource's current content, letting clients use It with If-Match or If-None-Match for precise cache validation and safe concurrent updates.

Example

ETag: "686897696a7c876b7e"

History

Part of the original HTTP/1.1 specification, RFC 2068 (1997).

Did you know?

There are two flavours - a plain ETag guarantees byte-for-byte identical content, while a W/"weak" ETag only guarantees the content is semantically equivalent, which matters for things like whitespace-only differences.