DevToolsmith

If-None-Match Header

The If-None-Match request header asks the server to send the resource only if its ETag differs from the ones listed.

Type
Request header
Category
Caching
Defined in
RFC 9110

Syntax

If-None-Match: "<etag>", "<etag>"  |  If-None-Match: *

How If-None-Match works

Browsers add it automatically when revalidating a cached response that had an ETag. A match gets 304 Not Modified and the browser reuses its copy. On a PUT, If-None-Match: * means “only create this if it doesn’t exist yet”, which prevents overwriting.

Examples

Revalidating a cached response
If-None-Match: "33a64df551425fcc55e4d42a148795d9f25f89d4"
Create only if missing (PUT)
If-None-Match: *

Common mistakes

  • When both are sent, If-None-Match wins over If-Modified-Since.

Check it

# Show the request headers curl sends (lines starting with >)
curl -sv -o /dev/null https://example.com 2>&1 | grep '^>'

Paste a full set of response headers into the HTTP header checker to get every header explained and common mistakes flagged.

Related headers

  • ETag: gives a version identifier to a response, so caches can ask “has it changed?” cheaply.
  • If-Modified-Since: asks for the resource only if it changed after the given date.
  • Cache-Control: tells browsers, CDNs and proxies whether a response may be stored, by whom, and for how long.

More caching headers

Last-Modified , Expires , Age , Vary .

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What does the If-None-Match header do?

The If-None-Match request header asks the server to send the resource only if its ETag differs from the ones listed. Browsers add it automatically when revalidating a cached response that had an ETag. A match gets 304 Not Modified and the browser reuses its copy. On a PUT, If-None-Match: * means “only create this if it doesn’t exist yet”, which prevents overwriting.

How do I see the If-None-Match header?

Open your browser’s dev tools, select a request in the Network tab and look under Request Headers. On the command line, "curl -v https://example.com" prints the request headers it sends, marked with ">".