CachingResponse Header

ETag (Entity Tag)

Unique hash or identifier for a specific version of a resource, allowing efficient cache revalidation with 304 Not Modified responses.

Recommended Production Value
Context-Dependent
W/"33a64df551425fcc55e4d42a148795d9f25f89d4"

Production Server Implementation

NGINX Configuration Snippet
etag on; # Default in modern NGINX versions

Directives & Syntax Breakdown

W/ (Weak Validator)

Indicates the resource is semantically equivalent even if byte-by-byte representations differ slightly.

Strong ETag

Requires strict byte-for-byte identity matching between client and server copies.

Common Security Hazards & Pitfalls

  • β€’In multi-server load-balanced environments, ensure all server nodes generate identical ETags for identical content.
Frequently Asked Questions

ETag (Entity Tag) - Questions & Answers

Common implementation questions, browser enforcement rules, and debugging.

When a cached file expires, the browser sends "If-None-Match: <etag>". If unchanged, the server returns a 304 Not Modified with zero body payload.