The HTTP Header If-None-Match is a request-type header. Generally, it is used to update the entity tags on the server. Firstly, the Client provides the Server with a set of entity tags (E-tags). The Server compares the given tags with those it already has for the resource. Then, the Server will provide the requested page with a 200 status code only when none of the entity tags given to it matches. Or else, a 304 Not Modified status is returned by the Server.
There are two types of algorithms used to compare the entity tags. They are:
- Weak Comparison Algorithm
- Strong Comparison Algorithm
Weak comparison algorithm: It neglects minor differences which are considered to be unimportant between the entity tags. For example, two tags having the same contents but with different dates are considered to be identical.
Strong comparison algorithm: It checks the tags byte-to-byte.
Note : “*” is used to represent any resource.
Directives: This header accepts two directives as mentioned above and described below:
- entity_tag: It represents the resource which is requested. It is a string which contains alphabets, numbers and other special characters enclosed within double quotes (” “).
- “*”: It represents any resource and is used to avoid race conditions between PUT operations. When this directive is used, the server should not perform the requested method if the entity is given to it already exists for that resource.
To check this If-None-Match in action go to Inspect Element -> Network check the request header for If-None-Match like below. The If-None-Match header is highlighted.
Supported Browsers: The browsers are compatible with HTTP If-None-Match header are listefd below:
- Google Chrome
- Internet Explorer
- Mozilla Firefox
- Microsoft Edge
- HTTP headers | Access-Control-Expose-Headers
- HTTP headers | Access-Control-Allow-Headers.
- HTTP headers | Access-Control-Request-Headers
- HTTP headers | Location
- HTTP headers | User-Agent
- HTTP headers | Link
- HTTP headers | Save-Data
- HTTP headers | Content-Type
- HTTP headers | X-Forwarded-Proto
- HTTP headers | X-XSS-Protection
- HTTP headers | X-Frame-Options
- HTTP headers | Last-Modified
- HTTP headers | Date
- HTTP headers | Cookie
- HTTP headers | Strict-Transport-Security
- HTTP headers | Expect
- HTTP headers | Accept-Encoding
- HTTP headers | Proxy-Authenticate
- HTTP headers | Content-Range
- HTTP headers | Content-Encoding
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.