Free auditStart free
GlossaryGlossary · Crawling and indexing

ETag

The ETag header labels one version of a resource so browsers and crawlers can revalidate with If-None-Match and get a 304. Syntax, weak vs strong, and a check.

3 min
read
2
sources
Nov 1, 2026
updated
Scaplet Editorial Team
author
In one line

An ETag is an HTTP response header that identifies one version of a resource. A client stores it, then sends it back in If-None-Match when the cached copy goes stale. If the version is unchanged, the server answers 304 Not Modified with no body, so nothing is re-downloaded.

30-second check

Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode

At a glance

4 facts from the sources below
Server, in the response
Sent by
If-None-Match (reads) or If-Match (writes)
Returned in
304 Not Modified, no body
Unchanged result
Strong, or weak with a W/ prefix
Forms
01At a glance

Anatomy of an ETag exchange

An ETag is a label for a version of a resource, and it has to change whenever the resource changes. The value is a quoted ASCII string. The spec doesn't say how to build it, so servers commonly hash the content, hash a timestamp, or use a revision number. This also covers the broader idea of conditional requests: requests whose outcome depends on a validator the client supplies, such as an ETag or a Last-Modified date.
Part

ETag response header

Job
Names the version the server just sent
Part

If-None-Match request header

Job
Sends the stored ETag back and asks: send the body only if it differs
Part

304 Not Modified

Job
Version still matches. No body, the client reuses its cached copy
Part

200 OK

Job
Version changed. The new body and new ETag arrive together
Part

If-Match request header

Job
Used on writes: proceed only if the stored version still matches, otherwise 412 Precondition Failed
First load, then revalidation
GET /guide HTTP/1.1

HTTP/1.1 200 OK
ETag: "33a64df5"
Cache-Control: max-age=3600

(an hour later, cached copy is stale)

GET /guide HTTP/1.1
If-None-Match: "33a64df5"

HTTP/1.1 304 Not Modified
ETag: "33a64df5"
03Check it

Check it in 2 minutes

Run it against your own URL. If the second line prints 200 instead of 304, the server isn't honoring If-None-Match, or something in front of it changed the ETag. Not every site sends an ETag at all, so an empty first line is a finding too.

Fetch the ETag, then replay it
U=https://developer.mozilla.org/en-US/
E=$(curl -sI $U | grep -i '^etag' | cut -d' ' -f2- | tr -d '\r')
echo "$E"
curl -s -o /dev/null -w "%{http_code}\n" -H "If-None-Match: $E" $U   # 304 means the validator works
curl -s -o /dev/null -w "%{http_code}\n" $U                          # 200 without the header
04Your call

Do you need to touch it?

If this fits

Leave it on if

  • Your web server or CDN generates ETags automatically and revalidation returns 304
  • Pages change rarely, so most re-requests can be answered without a body
  • You also send Cache-Control, so the ETag only matters once the copy is stale
Or

Investigate if

  • Several servers behind a load balancer return different ETags for identical content
  • Compression or a proxy rewrites the value and 304s never happen
  • You use ETags for edit conflicts and need strong validation on writes

An ETag only saves transfer on a repeat request, and it doesn't replace freshness rules. See HTTP caching for how Cache-Control decides when a cached copy needs checking at all.

Sources · 2

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • mozilla.org
  1. 01ETag header (MDN)developer.mozilla.org · checked 2026-11-01
  2. 02HTTP conditional requests (MDN)developer.mozilla.org · checked 2026-11-01
Questions

Asked a lot.

2 questions people ask next, answered from the sources on this page.

01What is the difference between ETag and Last-Modified?

Both are validators. Last-Modified is a date, while an ETag is an opaque string the server generates for each version. Clients can send either back, in If-Modified-Since or If-None-Match, to revalidate a stale copy.

02Are conditional requests the same thing as an ETag?

No. A conditional request is any request whose outcome depends on a precondition header. An ETag is one of the two validators those preconditions compare against, the other being Last-Modified.

Free · 2 minutes

Know the term. Now check your site.

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly