Skip to content

Test when 304 responses alter a Vary header - #212

Draft
dfoxfranke wants to merge 2 commits into
http-tests:mainfrom
dfoxfranke:vary-altered-by-304
Draft

dfoxfranke wants to merge 2 commits into
http-tests:mainfrom
dfoxfranke:vary-altered-by-304

Conversation

@dfoxfranke

Copy link
Copy Markdown

This PR is follow-up to the HTTP WG thread at https://lists.w3.org/Archives/Public/ietf-http-wg/2026OctDec/0030.html. It tests a cache's behavior when the cache has a stale stored response which could be freshened according to §4.3.4 on the basis of a weak validator match, but the 304 response has a conflicting Vary header which makes the stored body unsuitable for answering the client's request.

It also adds an optimality test to see if a cache will use a weak Last-Modified timestamp to revalidate a stale response when the client's request is unconditional. This is a dependency for one of the Vary tests.

TODO before I move this out of draft status:

  • Make it possible to actually get a passing result. Correct implementations (of which there aren't any at present) can't satisfy the request without a retry, so they'll appear as ↺ rather than ✓, and the test will end before it has fully verified that the final response to the client is correct. Fixing this will require improvements to the test harness.

  • Fix flakiness in the optimality test. Currently it sends ['Last-Modified', 0] and then ['Last-Modified', -3] three seconds later and expects this to be same value, but due to processing delays it occasionally won't be. I need to add a magic_lm option analogous magic_ims.

  • Catch caches that cheat on this test by ignoring no-transform and compressing the stored body.

  • Add some discussion and spec references.

This helps with the vary-altered-by-304 tests. If a cache serves
a plaintext body with Content-Encoding: gzip, we'll report a
comprehensible failure message rather than just "terminated".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant