﻿# HTTP If-Match: strong validators and stale configuration updates

Use a resource validator to detect stale API updates, distinguish HTTP If-Match from product-specific etag fields, and avoid overwriting concurrent changes.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/guide-http-ifmatch-strong-resource-version/
Language: en

## A read can become stale before an update

An application reads a model configuration, changes one setting and later writes the object back. Another administrator may have changed the resource in between. An unconditional write can silently replace that intervening update.

HTTP If-Match lets a request express a precondition using a previously obtained entity tag. It is useful when a consumer needs evidence that the resource still corresponds to the representation on which its edit was based. The validator is a concurrency input, not a user-visible revision label to reconstruct manually.

## Strong comparison has a specific meaning

The HTTP conditional request uses strong entity-tag comparison. MDN documents that a weak tag carrying the weak prefix will not satisfy that comparison. A consumer should not remove the prefix to manufacture an apparently strong tag.

Preserve the server-issued value according to the API's contract. A tag that looks like a hash is not automatically a documented content checksum, and its internal format need not remain stable. The relevant question is whether the server accepts the supplied validator for the intended operation.

## A product etag field can follow another contract

Google's resource-freshness guidance uses an etag field in resources or request messages and defines its own handling for mismatches and omission. This illustrates a related concurrency pattern, but it should not be confused with an automatic implementation of HTTP If-Match.

Read the specific API definition. A body field, a conditional header and a client-side revision check can produce different failure codes and omission behavior. A generic adapter that maps them all to the same assumptions can weaken the protection it appears to provide.

## A failed precondition needs a merge decision

When a stale update is rejected, simply reading the newest tag and resending the old body can overwrite exactly the change the precondition protected. The application needs to revisit the intended edit against the current resource.

A proposed configuration editor presents the changed fields and asks its merge logic to preserve unrelated updates. Automated reconciliation needs equally explicit ownership rules. The validator detects a conflict; it does not establish which administrator's intended value should win.

## Scope the check to the actual resource

A configuration collection and an individual configuration can have different validators. Use the value belonging to the representation the API defines for that update, and preserve any required tenant or resource identity.

A useful compatibility review distinguishes matched, stale, weak and omitted validators and records the documented outcomes. This makes concurrency protection reviewable without claiming that one successful conditional write establishes transaction isolation for an entire model-management workflow.

## Primary references

[HTTP conditional request semantics](https://www.rfc-editor.org/rfc/rfc9110.html#name-if-match).

[MDN If-Match reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Match).

[Google resource freshness guidance](https://google.aip.dev/154).

Related explanations: [API contract changes](/journal/provider-api-contract-deprecation-migration/); [Operation identity](/journal/provider-post-retry-idempotency-ledger/).
