Knowledge Base

ETag

An ETag identifies a response representation for validation. It can save a full download when the stored version is still current.

A validator, not a lifetime

ETag: "release-42"
Cache-Control: max-age=300

ETag is an opaque, quoted identifier. The server decides how to generate it and must change it when the representation changes in a way relevant to that validator.

Cache-Control supplies freshness rules. An ETag alone does not make a response fresh for five minutes or authorize storing private content in a shared cache.

Conditional requests

For validation, a client can send If-None-Match: "release-42". If the current representation matches, a GET or HEAD request can receive 304 Not Modified without the response body.

For other methods, a failed If-None-Match condition results in 412 rather than 304. Preconditions need application support; an ETag does not automatically prevent conflicting edits.

Strong and weak values

"release-42" is strong; W/"release-42" is weak. A weak tag allows semantic equivalence without guaranteeing identical bytes. It is useful for ordinary validation but unsuitable where byte identity is required, such as If-Range validation.

Check compressed and uncompressed variants, generated pages, and multiple origin servers. A constant tag or one based on the wrong file can validate stale content incorrectly. See Vary and representation selection.

Technical sources

Copyright ©2026 MILAN INNOVATIONS LLC. All rights reserved.