If-Match
- Condition
- The resource's current ETag matches one in the list (or
*and it exists) - When it fails
- The ETag differs, so someone changed the resource
HTTP 412 means a condition in your request headers, such as If-Match, was false on the server. See why it happens, how to retry, and how developers handle it.
HTTP 412 Precondition Failed means one or more conditions in the request headers, such as If-Match, If-Unmodified-Since or If-None-Match, evaluated to false on the server, so the server did not apply the method. It usually signals a stale copy or a lost-update guard. Fetch the current version and ETag, merge, then retry.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
It is the server saying: you asked me to act only if the resource still looks a certain way, and it no longer does. MDN describes it for conditional requests on methods other than GET or HEAD when the condition defined by headers such as If-Unmodified-Since or If-Match is not met. That makes it a deliberate safeguard, not a malfunction.
If-Match* and it exists)If-Unmodified-SinceIf-None-MatchIf-Match: *RFC 9110 says If-Match is most often used with state-changing methods (POST, PUT, DELETE) to prevent accidental overwrites when several clients may act on the same resource, which it calls the lost update problem. RFC 9110 also fixes the order of evaluation: when If-Match is present it is checked first, and a false result means a 412 unless the server can tell the change was already applied. A server must ignore If-Unmodified-Since when the request also has If-Match.
The RFC allows an alternative: if the state-changing request appears to have already been applied, a server may respond with a 2xx code instead. A client that lost a response and retries might therefore get a success rather than a 412.
Your edit was based on an out-of-date copy. Reloading fetches the current version and its ETag.
If another person or process updated the resource, merge their change with yours.
Send the update again with the new If-Match value, or the new date for If-Unmodified-Since.
Make sure the client is sending the ETag it just received, byte for byte, quotes included. A rewritten or weak ETag will not match under strong comparison.
ETag for the page. When the user saves, the client sends it back in If-Match. If the hashes do not match, the document was edited in between, and the server returns a 412.If-Match.GET /pages/42 HTTP/1.1
HTTP/1.1 200 OK
ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4"
PUT /pages/42 HTTP/1.1
If-Match: "33a64df551425fcc55e4d42a148795d9f25f89d4"
HTTP/1.1 412 Precondition FailedCrawlers fetch pages with plain GET requests that carry no write preconditions, so a 412 on a public page is unusual and points to a misconfigured rule. Google handles it like other 4xx codes except 429: the content isn't used, and indexed URLs that return it are removed from the index. See 4xx errors.
4 questions people ask next, answered from the sources on this page.
It is the Precondition Failed status code. A condition in the request headers, such as If-Match or If-Unmodified-Since, evaluated to false on the server, so the server refused to apply the method.
Reload to get the current version and its ETag, merge your change, and resend with the new If-Match value. If it always fails, check that the client sends back the exact ETag it received.
A 412 is triggered by a precondition header that evaluated to false. A 409 says the request conflicts with the current state of the resource, whether or not validators were used.
No. The server did not apply your request because the resource was not in the state you expected. Nothing was overwritten, which is the point of the precondition.
Run the free audit, then approve the fixes. Every change can be undone.