Refactor cache fixture & annotate differences#476
Merged
cceckman-at-fastly merged 7 commits intomainfrom May 23, 2025
Merged
Conversation
5f34d05 to
474c7ce
Compare
60049f6 to
e2bad60
Compare
474c7ce to
b872734
Compare
e2bad60 to
1b3e592
Compare
Compute Platform treats "a comma-separated list" and "separate headers" distinctly.
1b3e592 to
529cb7c
Compare
ulyssa
approved these changes
May 23, 2025
| pub fn variant(&self, headers: &HeaderMap) -> Variant { | ||
| let mut buf = BytesMut::new(); | ||
| // Include the count, to avoid confusion from values that might contain our marker phrases. | ||
| buf.extend_from_slice(format!("[headers: {}]", self.headers.len()).as_bytes()); |
Contributor
There was a problem hiding this comment.
Just to make sure I'm understanding variant() correctly: it's okay for this format to change because this is just an internal detail we use to consistently map VaryRule/HeaderMap combinations?
Contributor
Author
There was a problem hiding this comment.
Yes - the format is an implementation detail. We could replace headers here with MyFavoriteString and it wouldn't be a user-visible change.
"Whether two normalized forms match" is a behavioral change; and specifically, this is a behavioral change to match Compute's behavior. (This is based on the internal code.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor the cache test fixture so it can be run as a Compute service directly.
By doing so, I've found a few divergences. Some I've fixed in Viceroy, some have fixes rolling out in Compute, and some are just going to be a little different :(
vary_byhandling to match compute: don't infer any HTTP-like semantics of comma-separated values. Treat distinct headers as distinct, and encode more structure into thevary_byrule.Bodyis read before the re-retrieving theBodyfrom aFound, Viceroy only requires that theBodyis closed. I'm not trying to fix this at the moment.Foundfor stale (not stale-while-revalidate); Viceroy does. I'm also not trying to fix this; Viceroy presents a superset of the behaviors that Compute could offer, so "it works on Viceroy" is sufficient for "it works on Compute".CacheBusyHandledrops, but test the fixed behavior.