शब्दकोश · परफ़ॉर्मेंस

ETag (Entity Tag)

An ETag is an HTTP response header holding a version identifier for a resource, letting clients revalidate cached copies and receive 304 Not Modified.

अपडेट: अक्टूबर 6, 2026

An ETag (entity tag) is an opaque identifier the server attaches to a specific version of a resource, usually a hash of its content or a version number. When the resource changes, the ETag changes.

Why it matters

Once a cached copy goes stale, the browser can ask the server whether it is still valid instead of downloading it again. It sends the stored tag in an If-None-Match header. If the tag still matches, the server replies 304 Not Modified with no body, saving the transfer but not the round trip.

ETags can be strong ("abc123", byte-identical) or weak (W/"abc123", semantically equivalent). They also work for conditional writes with If-Match, preventing lost updates in APIs.

Example

GET /styles.css
200 OK
ETag: "5d8c72a5"

GET /styles.css
If-None-Match: "5d8c72a5"
304 Not Modified

Common mistakes

  • Multiple servers generating ETags from file inode and timestamps, so the same file gets different tags behind a load balancer and revalidation always fails.
  • Assuming an ETag replaces freshness headers. Without max-age, the browser may revalidate on every load.
  • Compression layers rewriting content but leaving the tag identical, or changing it inconsistently.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.