-
Notifications
You must be signed in to change notification settings - Fork 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
pip install does not support 303 (See Other) as valid cacheable response #8489
Comments
This is a significant blocker for out teams. What would be required to get this pushed through? |
AFAIK, 303 is generally treated as temporary redirect in practice, and the client is supposed to query the original URL again next time. So IMO pip is correct to not cache 303. |
From a purely technical perspective, but I believe in this instance their implementation uses the 303 to handle authentication. In this case the URL with authentication is 303 redirected to the URL to pull the actual package, thus a temporary redirect is a viable use of a 303 redirect, that ultimately returns the exact same package. Each user requesting the package would be doing so under a different set of credentials. |
I’m likely missing something here. So the authentication system returns 303 that points to the actual package, which pip would proceed to request for download. Wouldn’t pip be able to cache that request to the actual package instead, assuming it returns a cachable response? |
For context, this is relative to Azure DevOps' implementation of a python artifact (PyPI) style feed. I'm hoping the individual who has debugged the code replies, but it is my understanding that the initial request is performed with authentication parameters, the 303 is issued to then point to a URL where the actual package resides. Thus in the case where I have had |
Ah that would make sense, thanks. Let’s hope @shadargee1982. In the mean time I’ll put this on my backlog and look into it when I get the time. |
pip's caching works at the HTTP layer, so it should not cache the 303 response, but it should still be able to cache the URL that the 303 redirects to, assuming that URL is cacheable at all at the HTTP layer. It would be useful if someone could do a |
@shadargee1982 any thoughts on the conversations above? |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
Environment
Description
We have a private packages host that provides capabilities to install python packages. Along the way, the download URL that returns a 303 to the client with a signed URL that is then used as the url for download. Because pip does not save the original download URL, there is always a cache miss in pip resulting in longer build times.
Expected behavior
pip's caching happens at a per-http call level. In other words, pip's cache is Dictionary<Uri,Response>. If pip's cache were a Dictionary<PackageIdentity,byte[]>, then this problem would not occur.
How to Reproduce
requirements.txt has a single numpy v.1.18.1
python -m pip install --upgrade pip wheel && pip install -v -r requirements.txt
Output
The text was updated successfully, but these errors were encountered: