Skip to content

Range requests for cache API#473

Merged
cceckman-at-fastly merged 6 commits intomainfrom
cceckman/cache-range
Jul 17, 2025
Merged

Range requests for cache API#473
cceckman-at-fastly merged 6 commits intomainfrom
cceckman/cache-range

Conversation

@cceckman-at-fastly
Copy link
Copy Markdown
Contributor

@cceckman-at-fastly cceckman-at-fastly commented May 5, 2025

Support range requests in the cache API. This completes options processing for the core cache API.

According to the tests, this matches the always_use_requested_range behavior of the Compute platform.

@cceckman-at-fastly cceckman-at-fastly changed the base branch from main to cceckman/user-metadata May 5, 2025 16:22
@cceckman-at-fastly cceckman-at-fastly force-pushed the cceckman/user-metadata branch from 5b0f342 to ef2fea9 Compare May 6, 2025 12:21
@cceckman-at-fastly cceckman-at-fastly force-pushed the cceckman/cache-range branch 3 times, most recently from 191b54f to 889d6e1 Compare May 6, 2025 20:07
@cceckman-at-fastly cceckman-at-fastly changed the base branch from cceckman/user-metadata to cceckman/cache-length May 6, 2025 20:08
Base automatically changed from cceckman/cache-length to main May 9, 2025 17:04
@cceckman-at-fastly cceckman-at-fastly marked this pull request as ready for review May 9, 2025 17:17
@cceckman-at-fastly cceckman-at-fastly requested a review from aturon May 9, 2025 17:18
@cceckman-at-fastly
Copy link
Copy Markdown
Contributor Author

@aturon and I discussed this today. While this accurately represents what Compute Platform does... this is a bad behavior and we don't want to support it.

We have a strategy to roll out a fix that gives the sensible behavior for to_stream_from_range. I'm going to switch this back to a draft, and will eventually republish it with the revised behavior.

@cceckman-at-fastly cceckman-at-fastly marked this pull request as draft May 9, 2025 18:39
@cceckman-at-fastly cceckman-at-fastly removed the request for review from aturon June 13, 2025 15:54
@cceckman-at-fastly cceckman-at-fastly force-pushed the cceckman/cache-range branch 3 times, most recently from c68bed8 to 5274dd5 Compare July 2, 2025 17:24
@cceckman-at-fastly cceckman-at-fastly changed the base branch from main to cceckman/stream-back July 2, 2025 17:24
@cceckman-at-fastly cceckman-at-fastly marked this pull request as ready for review July 3, 2025 15:20
Base automatically changed from cceckman/stream-back to main July 16, 2025 15:53
In the most recent builds of the compute platform, get_body can block
until the start of the requested range is available (if the
always_use_requested_range flag is set).

Prepare for this by making get_body async, using a named `impl Future`
that can hold the range-related options.
Allow `read_range` in CollectingBody with a start (and optional end)
offset. Add helpers to allow waiting for a known or minimum length,
which we need to get a consistent blocking behavior with Compute.

Add the proptest regressions files for body and collecting_body.
Copy link
Copy Markdown
Contributor

@aturon aturon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fabulous work! Greatly appreciate the clarity of the code given how gnarly the matrix of possible situations is 👏👏👏

I've read over quite carefully, and don't see anything that needs further refinement.

@cceckman-at-fastly cceckman-at-fastly merged commit 3763c50 into main Jul 17, 2025
15 checks passed
@cceckman-at-fastly cceckman-at-fastly deleted the cceckman/cache-range branch July 17, 2025 14:25
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.

2 participants