
The edit page loads, but clicking Save returns 412 Precondition Failed. Compare the ETag from the GET that loaded the page, the precondition sent with the write, and the ETag the origin evaluated. Those values help you tell whether the client started with a cached version, a proxy changed the header, or another operation updated the resource before the save.
Find the failed precondition
Record the request ID, timestamp, method, and resource path for both the read and the write. Trace the write through CDN, gateway, and origin logs to see which layer returned 412 and which conditions reached the origin. If the outgoing If-Match differs from the value the origin saw, check how the SDK constructs the header and how each proxy forwards it.
If-Match: "v17" requires a strong match against the ETag of the selected representation. A weak tag such as W/"v17" fails that comparison even though the quoted value is the same. Use the strong ETag or version field specified by the API. If-Match: * checks whether the target has a current representation and provides no protection against overwriting a specific version.
If the write used If-None-Match: *, check whether it was meant to create a resource only when the target was absent. An existing representation fails that precondition. A failed If-None-Match condition can yield 304 on GET or HEAD and 412 on a write. When the request carries several conditions, check the evaluation order in RFC 9110.
Compare the version returned by the read with the version at the origin
Concurrent update. Client A loads
"v17", then client B saves"v18". Rejecting A's save withIf-Match: "v17"protects B's changes. Check audit records for other editors and background jobs that might have advanced the version. Reload the current resource and let the user resolve the conflict, or merge the changes under the application's rules before submitting again.Cached read. Compare the GET response with the origin's version history. CDN cache status,
Age,Cache-Control, and request timing can help establish whether the page loaded an older version. A missingAgeheader leaves the read path unconfirmed. For user-specific or tenant-specific data, check that shared caching and cache keys preserve isolation.Different representations or backends. Compare
Content-Encoding,Vary, andETagto see whether the tag from the GET applies to the representation selected for the write. If reads and writes reach different backends, check which version each one used and whether their version stores were in sync.
Keep the original precondition while investigating. Dropping it, stripping W/, or attaching a fresh tag to the old body can defeat conflict protection.
Test both writes on a disposable resource
Use a test API that supports GET, PUT, and strong ETags. Set url to a disposable resource and prepare two different, valid representations in first.json and second.json. Run the GET and check its status. Copy the strong ETag from read.headers into etag with the double quotes intact.
url='https://api.example.com/test/items/probe'
curl -sS --max-time 15 -D read.headers -o read.json \
-w 'Read: %{http_code}\n' "$url"
# Replace the sample value with the strong ETag from read.headers.
etag='"v17"'
curl -sS --max-time 15 -X PUT \
-H 'Content-Type: application/json' -H "If-Match: $etag" \
--data-binary @first.json -o first-response.json \
-w 'First write: %{http_code}\n' "$url"
# Confirm the first write succeeded and the origin's ETag advanced.
# Then submit a different body with the same old tag.
curl -sS --max-time 15 -X PUT \
-H 'Content-Type: application/json' -H "If-Match: $etag" \
--data-binary @second.json -o second-response.json \
-w 'Second write: %{http_code}\n' "$url"Use a read path that returns the current origin version or check the origin audit log between writes. The second write should return 412, and a final read should still show the content from first.json. Repeat the check with the deployed SDK and confirm that the edit page keeps the user's unsaved changes when it reports the conflict.
References
References checked on December 1, 2026.