If-None-Match
What is If-None-Match?
If-None-Match: Send the request only if the resource's ETag is NOT what the client already has. Triggers 304 Not Modified if unchanged. If-None-Match asks the server to send the resource only if its current ETag differs from the one the client has. If they match, the server replies 304 Not Modified without a body.
Frequently asked questions about If-None-Match
How is If-None-Match used in practice?
Browsers send it automatically for cached resources that came with an ETag. It is the standard way to check whether a cached page or API response is still current, at the cost of one small request.
What should you keep in mind with If-None-Match?
It is also used with * on uploads: If-None-Match: * means only create this resource if it does not exist yet, which prevents overwriting a file someone else just created. For APIs that return large JSON responses that rarely change, adding ETags and honouring this header can cut bandwidth and response times noticeably.
What does an example of If-None-Match look like?
If-None-Match: "abc123" At a glance
| Category | HTTP headers |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |