The conditional-write boundary

An HTTP conditional request carries a test that the origin evaluates before it carries out the requested action. For a state-changing request using If-Match, a false test means the origin must not apply that method. This provides a protocol mechanism for avoiding an older editor overwriting a concurrent editor’s work.

Think of the validator as evidence about one selected representation, rather than a general statement that a resource name exists. After a successful state-changing request, a response ETag can describe the replacement representation and can later be used as a validator.

This is a conditional-write contract for an origin server. Before relying on it, verify that each target endpoint evaluates If-Match, produces suitable strong ETags, and documents its failure response.

Choose a strong representation validator

A tag list in If-Match succeeds when at least one supplied tag strongly matches the ETag of the representation selected by the server. Strong comparison concerns identical representation data, so a weak tag marked with W/ cannot satisfy this precondition.

The wildcard form has a different purpose. If-Match: * evaluates true when a current representation exists at the origin; it evaluates false when none exists. It therefore checks existence, not whether the caller still has the version it previously read.

Decision guide for conditional saves and review
SituationEvidence retainedDocumented condition outcomeBounded application-owned next step
Matching strong ETagThe strong tag received with the edited representationA listed tag that strongly matches the selected representation makes the condition true.Submit the intended change and retain any returned replacement validator.
Stale strong ETagThe earlier strong tag and the unsaved draftIf no listed tag matches, the condition is false; the requested method is not performed, and a 412 response is permitted.Keep the draft; begin the proposed review path rather than replacing its validator silently.
Weak ETagThe received weak-tag marker and draftA weak entity tag cannot pass the strong comparison required by If-Match.Obtain an appropriate strong validator before offering a representation-specific save.
Wildcard with a current representationThe request used the wildcard and the operation contextThe wildcard condition is true when the origin has a current target representation.Use this only where existence is the application’s intended condition.
Wildcard with no current representationThe wildcard request and absence outcomeThe wildcard condition is false when the origin lacks a current target representation.Handle the result under the application’s chosen missing-resource policy.
Conflict review after 412The draft, prior validator, response status, and a newly fetched version if availableFor an unsatisfied If-Match condition on a non-GET or non-HEAD request, 412 identifies a failed precondition.Proposed policy: preserve, fetch, compare, ask for review, then resubmit only with newly obtained evidence.

A hypothetical two-editor timeline

Illustrative scenario: editors A and B each read a document carrying the same strong ETag, then A saves a revision first. B later sends its retained tag with a conditional save. If A’s save changed the selected representation so B’s tag no longer matches, B’s method is blocked; B keeps its unsaved draft for the review path.

This is a hypothetical sequence, not an observed API result. Its relevant protocol premise is that state-changing conditional requests can prevent parallel clients from accidentally replacing one another’s changes.

Handle failure without inventing a merge

A 412 response is a useful signal that the relevant condition was not met for a modification-style request. It does not itself define the user interface, a content merge, or an authorization decision. Preserve the local draft and make fetch, compare, reviewer choice, and resubmission explicit proposed application policy.

There is an important response ambiguity: when a state-changing request appears already reflected in the selected representation, RFC 9110 allows a successful 2xx response even though the ordinary failed-precondition path can use 412. Treat that case as a separate product decision and collect endpoint-specific evidence before retry or conflict handling.

Limits and alternatives

Representation-specific optimistic concurrency is the preferred choice when a save must correspond to the exact version the editor saw. Existence-only wildcard checking is a viable alternative when the application merely requires a current representation, but it cannot detect that a caller’s previously viewed version is stale.

The recovery workflow described here is an article proposal, not a provider-prescribed implementation. It does not establish endpoint support, merge behavior, authorization, persistence, or a universal status-code contract. Confirm the target API’s representation selection, ETag strength, conditional-write behavior, and already-applied-operation handling.