← Rule catalog
lowexperimentaldiscoverability

Consolidated representation preference applied but Vary omits Prefer

MACHINE-REP-005 · v1.0

What it detects

The homepage honors 'Prefer: return=consolidated' but its Vary header omits 'Prefer'.

Why it matters

Without 'Vary: Prefer', a cache can serve the consolidated response to a client that never asked for it, or the plain response to one that did.

How to fix

- Send `curl -I -H "Prefer: return=consolidated" <homepage>` and check the `Vary` response header alongside `Preference-Applied`. - Add `Vary: Prefer` (alongside any existing Vary values) to the response whenever the `Prefer` header changes what's returned, so caches don't serve the consolidated response to a client that never asked for it (or vice versa). - Configure this at the same layer that sets `Preference-Applied` — they should always be added together. - Verify: `curl -I -H "Prefer: return=consolidated" <homepage>` and confirm the `Vary` header includes `Prefer` whenever `Preference-Applied` is present.

References

Last reviewed: 2026-09-01 · rule v1.0