Skip to content

Coverage gap: stale revalidation returning a full 200 must replace stored #184

@mnot

Description

@mnot

Coverage gap

When a cache revalidates a stale stored response and the origin answers with a full 200 (not a 304), the cache must use and store the new response, replacing the stale one (RFC 9111 §4.3.3). No test verifies the replacement: the existing stale test only asserts the request reached origin (not_cached), not that the new body/headers are then served and stored.

Currently tested

freshness-max-age-stale (tests/cc-freshness.mjs) — asserts not_cached only. conditional-lm-stale exercises the 304 revalidation path, not the full-200 replacement path.

Suggested test

Prime with a response that becomes stale (distinct body A). Second request: origin returns a fresh full 200 with body B. Assert request 2 returns B; then a third request is served cached and returns B (the new response was stored, not the stale A).

Tag

[MUST] — RFC 9111 §4.3.3


Filed from an AI-assisted (Claude Code) coverage audit against RFC 9111/9110, under maintainer direction. Absence was grep-verified; the spec section number and MUST/SHOULD/optimal strength are from model knowledge, not re-read from the RFC text — worth confirming before writing the test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions