Skip to content

Option to respect range during cache streaming #1184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cceckman-at-fastly
Copy link
Collaborator

@cceckman-at-fastly cceckman-at-fastly commented Jun 12, 2025

The core cache API allows for cache items to be concurrently streamed to / from the cache.

If:

  • The size of the cached item's body was not provided by the writer
  • The reader requests a specific range of the cached item's body (to_stream_from_range)
  • The writer and reader are concurrent, i.e. the body is streamed from one to the other

then today, the core cache API will ignore the requested range and provide the whole body. There is no explicit notification that the whole body is provided instead of a range.

In this SDK release, this remains the default behavior. However, lookup calls (lookup, transaction lookup) now offer an always_use_requested_range option. If set to true, body reads conducted as part of this lookup/transaction/replacement will always use the requested range, even when streaming.

In a future (major) SDK release, the default behavior will change to always_use_requested_range.

The core cache API allows for cache items to be concurrently streamed to / from the cache.
If:
- The size of the cached item's body was not provided by the writer
- The reader requests a specific range of the cached item's body (`to_stream_from_range`)
- The writer and reader are concurrent, i.e. the body is streamed from one to the other
the core cache API will ignore the requested range and provide the whole body.
There is no explicit notification that the whole body is provided instead of a range.

In this SDK release, this remains the default behavior. However, lookup calls (lookup, transaction lookup) now offer an `always_use_requested_range` option. If set to true, body reads conducted as part of this lookup/transaction/replacement will always use the requested range, even when streaming.

In a future (major) SDK release, the default behavior will change to `always_use_requested_range`.
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