ETag Header Explained

What the HTTP ETag header does and when it's used.

Published October 14, 2026

ETag is a response header holding an opaque identifier for a specific version of a resource, used for conditional requests and cache validation.

How it works

Clients send it back in If-None-Match; if unchanged, the server replies 304 with no body.

The ETag header is part of the HTTP message and is case-insensitive in name.

In a real exchange

curl -i https://example.com/
ETag: "33a64df551425fcc"
Where ETag appears.

Practical examples

The header

ETag: "33a64df551425fcc"

Set or use it in code

res.set('ETag', hash(body))

Inspect it

curl -sI https://example.com | grep -i 'etag'

Common mistakes

  • Using weak or unstable ETags across servers
  • Generating from timestamps that change on deploy
  • Ignoring If-Match for writes

Key takeaways

  • ETag: ETag is a response header holding an opaque identifier for a specific version of a resource, used for conditional requests and cache validation.
  • Check it in browser DevTools → Network.
  • Test with curl -I before deploying.

FAQ

Strong vs weak ETag?

A weak ETag (W/"...") means semantically equivalent, not byte-identical.

Is ETag case sensitive?

Header names are case-insensitive; values may not be.

More HTTP articles