HTTP 412 Precondition Failed — Conditional Request Rejected
Warning4xx client error
Overview
HTTP 412 Precondition Failed means the server evaluated precondition headers (If-Match, If-Unmodified-Since) and the conditions were not met.
Key Details
- Occurs when conditional headers like If-Match or If-Unmodified-Since fail
- The server tested the precondition before executing the request and it was false
- Commonly used in optimistic concurrency control with ETags
- Prevents overwriting changes made by another client since your last read
- Different from 409 Conflict — 412 is specifically about conditional header evaluation
Common Causes
- If-Match header ETag does not match the current resource ETag
- If-Unmodified-Since date is older than the resource last-modified date
- Stale cache sending outdated conditional headers
- CDN or proxy adding conditional headers that conflict with server state
Steps
- 1Fetch the resource again to get the current ETag or Last-Modified value
- 2Update your If-Match header with the fresh ETag before retrying
- 3Clear browser cache if conditional requests are failing unexpectedly
- 4Check CDN cache settings if 412 errors appear intermittently
- 5Review your API client code to ensure ETags are refreshed after each modification
Tags
http412precondition-failedetagconditional-request
More in 4xx Client Error
http-400-bad-requestHTTP 400 Bad Request — What It Means & How to Fix It
Errorhttp-401-unauthorizedHTTP 401 Unauthorized — What It Means & How to Fix It
Errorhttp-402-payment-requiredHTTP 402 Payment Required — What It Means & How to Fix It
Errorhttp-403-forbiddenHTTP 403 Forbidden — What It Means & How to Fix It
Errorhttp-404-not-foundHTTP 404 Not Found — What It Means & How to Fix It
Errorhttp-405-method-not-allowedHTTP 405 Method Not Allowed — What It Means & How to Fix It
ErrorFrequently Asked Questions
412 means a precondition header check failed. 409 means the request conflicts with server state regardless of conditional headers.