Skip to content

Glossary

ETag

HTTP entity tag for cache validation

An ETag (Entity Tag) is an HTTP response header — typically a hash or version stamp of the response body — that lets a client revalidate a cached resource without downloading it again.

Workflow:

  1. First request: server returns the resource with ETag: "abc123".
  2. Client caches the response with the ETag.
  3. Next request: client sends If-None-Match: "abc123".
  4. Server compares the current ETag to the client’s. If equal: 304 Not Modified with an empty body, client uses its cached copy. If different: 200 OK with the new body and new ETag.

Two ETag flavours:

  • Strong ETags — change if the bytes change. Default.
  • Weak ETags — prefixed W/, may match across “semantically equivalent” responses (e.g., compressed vs uncompressed of the same content).

ETag is one of three HTTP cache-validation mechanisms (alongside Last-Modified + If-Modified-Since, and Cache-Control max-age). For modern static sites with content-hashed asset URLs, ETag is rarely necessary — but it remains the workhorse for dynamic APIs that want client-side caching.

Published May 15, 2026