A conditional request does not return 304

Match the request condition to the current selected representation before expecting 304.

  • caching
  • validators
  • diagnostics

Diagnostic overview

Symptoms

  • A GET with If-None-Match returns 200 instead of the expected 304.
  • The response entity tag differs even though the visible content looks unchanged.

Likely layers

client, shared cache, proxy, cdn, origin, protocol

Common causes

  • The selected representation or content coding has a different entity tag.
  • A weak or strong comparison rule does not match the chosen precondition.
  • The request reaches a different origin version or negotiation variant.

Diagnostic steps

  1. Capture the validator from the exact stored response and its Vary inputs.

    Look for: The entity tag and selection fields identify the representation being validated.

  2. Send one controlled conditional GET with the validator quoted exactly.

    Look for: The response status and current ETag show whether the condition matched.

  3. Compare routing, content coding, and deployment version across both exchanges.

    Look for: A changed variant or origin explains a new strong validator.

Targeted fixes

  • Generate stable validators per selected representation and version.
  • Preserve required quotation and weak-tag syntax in conditional fields.
  • Align cache variation and origin routing so the same request selects the intended representation.

Reuse the exact validator

Copy the entity tag from the stored response, including quotes and any W/ prefix. Preserve the request fields named by Vary.

GET /manual HTTP/1.1
Host: example.invalid
If-None-Match: "manual-v4"
Accept-Encoding: gzip

Expected result: 304 is possible only if the current selected representation matches under the applicable comparison rule. A changed representation correctly returns its normal response, often 200.

Check selection and routing

Content coding, language, host, query, authorization, deployment pool, and CDN key can select another representation. “Looks the same” is not strong-validator equivalence.

Interpret other statuses

Preconditions have a defined evaluation order and can produce 412 Precondition Failed in contexts where the condition blocks the method. Read the method and precondition definition instead of treating every non-304 result as a cache bug.

Primary sources