en-US/docs/Web/HTTP/Methods/GET) and
[ ` HEAD ` ](/en-US/docs/Web/HTTP/Methods/HEAD) methods, then the server must
return HTTP status code 304 (Not Modified). For methods that apply server-side
changes, the status code 412 (Precondition Failed) is used. Note that the
server generating a 304 response MUST generate any of the following header
fields that would have been sent in a 200 (OK) response to the same request:
Cache-Control, Content-Location, Date, ETag, Expires, and Vary.

The comparison with the stored [ ` ETag ` ](/en-US/docs/Web/HTTP/Headers/ETag)
uses the _weak comparison algorithm_ , meaning two files are considered
identical if the content is equivalent â they don't have to be identical
byte by byte. For example, two pages that differ by their creation date in the
footer would still be considered identical.

When used in combination with [ ` If-Modified-Since ` ](/en-
US/docs/Web/HTTP/Headers/If-Modified-Since) , **` If-None-Match ` ** has
precedence (if the server supports it).

There are two common use cases:

  * For [ ` GET ` ](/en-US/docs/Web/HTTP/Methods/GET) and [ ` HEAD ` ](/en-US/docs/Web/HTTP/Methods/HEAD) methods, to update a cached entity that has an associated [ ` ETag ` ](/en-US/docs/Web/HTTP/Headers/ETag) . 
  * For other methods, and in particular for [ ` PUT ` ](/en-US/docs/Web/HTTP/Methods/PUT) , ` If-None-Match ` used with the ` * ` value can be used to save a file not known to exist, guaranteeing that another upload didn't happen before, losing the data of the previous put; this problem is a variation of the [ lost update problem ](https://www.w3.org/1999/04/Editing/#3.1) . 

Header type  |  [ Request header ](/en-US/docs/Glossary/Request_header)  
---|---  
[ Forbidden header name ](/en-US/docs/Glossary/Forbidden_header_name) |  no   
  
##  Syntax

http

    
    
    If-None-Match: "<etag_value>"
    If-None-Match: "<etag_value>", "<etag_value>", â¦
    If-None-Match: *
    

##  Directives

<etag_value>

    

Entity tags uniquely representing the requested resources. They are a string
of [ ASCII ](/en-US/docs/Glossary/ASCII) characters placed between double
quotes (Like ` "675af34563dc-tr34" ` ) and may be prefixed by ` W/ ` to
indicate that the weak comparison algorithm should be used (this is useless
with ` If-None-Match ` as it only uses that algorithm).

` * `

    

The asterisk is a special value representing any resource. They are only
useful when uploading a resource, usually with [ ` PUT ` ](/en-
US/docs/Web/HTTP/Methods/PUT) , to check if another resource with the identity
has already been uploaded before.

##  Examples

http

    
    
    If-None-Match: "bfc13a64729c4290ef5b2c2730249c88ca92d82d"
    
    If-None-Match: W/"67ab43", "54ed21", "7892dd"
    
    If-None-Match: *
    

##  Specifications

Specification  
---  
[ HTTP Semantics  
#  field.if-none-match  ](https://www.rfc-editor.org/rfc/rfc9110#field.if-
none-match)  
  
##  Browser compatibility

BCD tables only load in the browser  with JavaScript enabled. Enable
JavaScript to view data.

##  See also

  * [ ` ETag ` ](/en-US/docs/Web/HTTP/Headers/ETag)
  * [ ` If-Unmodified-Since ` ](/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since)
  * [ ` If-Modified-Since ` ](/en-US/docs/Web/HTTP/Headers/If-Modified-Since)
  * [ ` If-Match ` ](/en-US/docs/Web/HTTP/Headers/If-Match)
  * [ ` 304 Not Modified ` ](/en-US/docs/Web/HTTP/Status/304)
  * [ ` 412 Precondition Failed ` ](/en-US/docs/Web/HTTP/Status/412)

##  Help improve MDN

Was this page helpful to you?

Yes  No

[ Learn how to contribute
](https://github.com/mdn/content/blob/main/CONTRIBUTING.md "This will take you
to our contribution guidelines on GitHub.") .

This page was last modified on  Aug 29, 2023  by  [ MDN contributors ](/en-
US/docs/Web/HTTP/Headers/If-None-Match/contributors.txt) .

[ View this page on GitHub
](https://github.com/mdn/content/blob/main/files/en-us/web/http/headers/if-
none-match/index.md?plain=1 "Folder: en-us/web/http/headers/if-none-mat