# 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.

Canonical: https://scaplet.com/glossary/etag

Glossary Glossary · Crawling and indexing

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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fetag%20(%22ETag%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fetag%20(%22ETag%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fetag%20(%22ETag%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fetag%20(%22ETag%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## 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

_01_At 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"
```

_02_At a glance

## Strong, weak, and Last-Modified

Validator

### Strong ETag

Looks like

`"abc123"`

Means

Byte-for-byte identical

Trade-off

Best for comparisons, harder to generate cheaply

Validator

### Weak ETag

Looks like

`W/"abc123"`

Means

Semantically equivalent, bytes may differ

Trade-off

Easier to generate, less useful for comparisons

Validator

### `Last-Modified`

Looks like

A date

Means

Resource last changed at this time

Trade-off

Date-based, so it identifies a version by time rather than by content

MDN notes that weak ETags prevent caching when byte-range requests are used, while strong ETags let range responses still be cached. Per MDN's conditional requests guide, `If-None-Match` uses weak validation and `If-Match` uses strong validation. The choice of validator and the strength of validation are independent.

**Compression can change the ETag**MDN's conditional requests guide says compression changes the content encoding, which calls for a different ETag, and that some servers and reverse proxies rewrite ETags when they compress. Apache appends the compression method by default, adjustable with `DeflateAlterETag`. If revalidation never returns 304 behind a proxy, compare the ETag before and after the proxy.

_03_Check 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
```

_04_Your 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](/glossary/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](/glossary/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. 01 [ETag header (MDN)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag) developer.mozilla.org · checked 2026-11-01
2. 02 [HTTP conditional requests (MDN)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Conditional_requests) developer.mozilla.org · checked 2026-11-01

Questions

## Asked a lot.

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

_01_ What 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.

_02_ Are 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.

## Keep learning

[All glossary](/glossary)

[Learn Cache-Control Performance](/glossary/cache-control) [Related X-Robots-Tag Crawling and indexing](/glossary/x-robots-tag) [Read next HTTP caching Performance](/glossary/http-caching) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[Enterprise SEO](/glossary/enterprise-seo) [Entity](/glossary/entity) [Evergreen Content](/glossary/evergreen-content) [Expired domain](/glossary/expired-domain)

More in Crawling and indexing
[Bing Webmaster Tools](/glossary/bing-webmaster-tools) [Bot management](/glossary/bot-management) [Broken links](/glossary/broken-links) [cache: search operator](/glossary/cache-search-operator) [Canonical HTTP header](/glossary/canonical-http-header) [Canonical URL](/glossary/canonical-url) [Client-side rendering](/glossary/client-side-rendering) [Crawl budget](/glossary/crawl-budget) [Crawl errors](/glossary/crawl-errors) [Crawl stats report](/glossary/crawl-stats-report) [Duplicate content](/glossary/duplicate-content) [Dynamic serving](/glossary/dynamic-serving) [ETag](/glossary/etag) [Google Indexing API](/glossary/google-indexing-api) [Google Search Console](/glossary/google-search-console) [HTML sitemap](/glossary/html-sitemap) [HTTP status codes](/glossary/http-status-codes) [HTTPS](/glossary/https) [Hydration](/glossary/hydration) [Index bloat](/glossary/index-bloat) [Indexability](/glossary/indexability) [Indexing](/glossary/indexing) [IndexNow](/glossary/indexnow) [Infinite scroll](/glossary/infinite-scroll)

Terms on this page
[Cache-Control](/glossary/cache-control) [HTTP caching](/glossary/http-caching)

Free · 2 minutes

## Know the term. _Now check your site._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
