-
Notifications
You must be signed in to change notification settings - Fork 5
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
Return response of initial HEAD request #1
Conversation
We need this response to determine our caching strategy.
This looks good to me but wouldn't you then also want to add additional headers to the initial request? |
src/lib.rs
Outdated
client: reqwest::Client, | ||
url: reqwest::Url, | ||
) -> Result<Self, AsyncHttpRangeReaderError> { | ||
) -> Result<(Self, reqwest::Response), AsyncHttpRangeReaderError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it makes sense to only return the headers of the request?
yes, i'll likely add that in the future, though i still have to figure out how to integrate this; i'm still looking for something that implements http caching semantics on top of reqwest without being a middleware, 06chaynes/http-cache#57). For pypi i get away with just checking if the cache control header says "immutable". |
Yeah I would like to have something like that too! Im following your issue. :) Would you be able to look at the other comments I left? |
Use range requests and async zip to extract the METADATA file from a remote wheel. We currently only cache when the remote says the remote declares the resource as immutable, see 06chaynes/http-cache#57 and prefix-dev/async_http_range_reader#1 . The cache is stored as json with the description omitted, this improve cache deserialization performance.
We need this response to determine our caching strategy, specifically we want to know if the response is immutable.
I'm not completely happy with that caching strategy yet but it works for pypi and wheels at a url should be immutable (otherwise you get a hash mismatch when deploying).