Skip to content
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

Proper caching support #2

Merged
merged 2 commits into from
Nov 10, 2023
Merged

Proper caching support #2

merged 2 commits into from
Nov 10, 2023

Conversation

konstin
Copy link
Contributor

@konstin konstin commented Nov 8, 2023

Split the AsyncHttpRangeReader constructor into the initial request and the subsequent processing and requests to allow moving the initial request into a cache framework. The usage for this is explained in 06chaynes/http-cache#57 (comment), with wheel_metadata_from_remote_zip being effectively https://github.com/prefix-dev/rip/pull/66/files#diff-831fc4351ab4266447169dae09f756a01f8c308e024e6836ec91a585695eb992R112-R204 .

The change requires the user to ensure they pass the correct response into new_tail_response/new_head_response.

Open questions: Which methods should be public, and which ones shouldn't be? Currently i just mad everything public.

Copy link
Collaborator

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

This looks good to me! But would you be able to add some comments to the public functions explaining how they should be used?

@konstin
Copy link
Contributor Author

konstin commented Nov 10, 2023

Added docs and in the process remove the url parameter from the response methods. This means that for each subsequent request, we will use the url that the first response returned (e.g. if there were redirects we followed)

@baszalmstra baszalmstra merged commit 8dab2c0 into prefix-dev:main Nov 10, 2023
3 checks passed
@konstin konstin deleted the caching branch November 10, 2023 10:57
@baszalmstra
Copy link
Collaborator

thanks @konstin ! Looks very good!

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