-
Notifications
You must be signed in to change notification settings - Fork 23.3k
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
Responses from https://download.pytorch.org/whl/cpu
have cache-control: no-cache
set in their headers
#130571
Comments
As the person who implemented |
These settings are currently set per object for our s3 files using Metadata section: These settings apply only to index.html files, not whl or tgz files. |
Lowering priority because it's only for the index. |
I think it's reasonable to cache index for 10 min or so |
Sorry for the delay. I'm going back through the links I recorded and actually am having a hard time finding 503 failures, but it's hard to reproduce especially since some auto-retries we do now make it so that this doesn't get flagged anymore. I remember seeing one of them and got it in my head that that was the most common and so put that in the "(e.g. with 503)" statement, but it looks like 500 errors were more common for me. Seems like this is getting into separate issue (from this caching issue) territory, but here's an example:
which is actually a bit strange since I don't see |
This changes the `Cache-Control` value for index pages from: `no-cache,no-store,must-revalidate` ...to: `max-age=600, public` In order to allow the pages to be cached for up to 10 minutes. The new value was chosen so that it matches that returned for PyPI index pages: ``` $ curl -sSI https://pypi.org/simple/ | rg cache-control cache-control: max-age=600, public ``` For explanations of the directives, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#response_directives Fixes #pytorch/pytorch#130571.
@atalman I've opened pytorch/test-infra#6188 for this :-) |
This changes the `Cache-Control` value for index pages from: `no-cache,no-store,must-revalidate` ...to: `max-age=600, public` In order to allow the pages to be cached for up to 10 minutes. The new value was chosen so that it matches that returned for PyPI index pages: ``` $ curl -sSI https://pypi.org/simple/ | rg cache-control cache-control: max-age=600, public ``` For explanations of the directives, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#response_directives Fixes #pytorch/pytorch#130571.
🐛 Describe the bug
Not sure if this is intentional, but it makes it difficult for the responses to play well with caching, e.g. this prompted the astral-sh/uv#4967 where it's unclear how to resolve.
FWIW,
and
In this particular instance this is manifesting as a problem for me because requests to https://download.pytorch.org/whl/cpu sometimes sporadically fail (e.g. with 503), so being able to reliably cache it would mitigate this considerably.
Versions
Fairly certain this issue is independent of my runtime and reproducible anywhere.
cc @ezyang @gchanan @zou3519 @kadeng @msaroufim @seemethere @malfet @osalpekar @atalman
The text was updated successfully, but these errors were encountered: