Skip to content

Update "Caching" section in User Guide #8009

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

Closed
var1abl3 opened this issue Apr 9, 2020 · 4 comments · Fixed by #8780
Closed

Update "Caching" section in User Guide #8009

var1abl3 opened this issue Apr 9, 2020 · 4 comments · Fixed by #8780
Labels
C: cache Dealing with cache and files in it good first issue A good item for first time contributors to work on type: docs Documentation related

Comments

@var1abl3
Copy link

var1abl3 commented Apr 9, 2020

Environment

  • pip version: latest
  • Python version: all
  • OS: all

Description
The "caching" section in the documentation is no longer accurate (and misleading). It states:
"When storing items in the cache, pip will respect the CacheControl header if it exists, or it will fall back to the Expires header if that exists. This allows pip to function as a browser would, and allows the index server to communicate to pip how long it is reasonable to cache any particular item."
However, max-age is hardcoded controller.py, and any such headers from the server are ignored:

149     resp = session.get(
150         url,
151         headers={
152             "Accept": "text/html",
153             # We don't want to blindly returned cached data for
154             # /simple/, because authors generally expecting that
155             # twine upload && pip install will function, but if
156             # they've done a pip install in the last ~10 minutes
157             # it won't. Thus by setting this to zero we will not
158             # blindly use any cached data, however the benefit of
159             # using max-age=0 instead of no-cache, is that we will
160             # still support conditional requests, so we will still
161             # minimize traffic sent in cases where the page hasn't
162             # changed at all, we will just always incur the round
163             # trip for the conditional GET now instead of only
164             # once per 10 minutes.
165             # For more information, please see pypa/pip#5670.
166             "Cache-Control": "max-age=0",
167         },
168     )

Expected behavior
The documentation should state the actual behavior.

How to Reproduce
N/A

Output
N/A

@ghost ghost added the S: needs triage Issues/PRs that need to be triaged label Apr 9, 2020
@sbidoul sbidoul added C: cache Dealing with cache and files in it type: docs Documentation related labels Apr 9, 2020
@ghost ghost removed S: needs triage Issues/PRs that need to be triaged labels Apr 9, 2020
@gutsytechster
Copy link
Contributor

Can I work on the issue? What I can understand is that we need to mention that pip uses its own Cache-Control settings in place of what is currently written.

@uranusjr uranusjr added the good first issue A good item for first time contributors to work on label Jul 25, 2020
@eamanu
Copy link
Contributor

eamanu commented Jul 29, 2020

@gutsytechster are you still interest on working on this issue? If not, I can work on it. :)

@pradyunsg pradyunsg changed the title Documentation no longer current Update "Caching" section in User Guide Jul 29, 2020
@gutsytechster
Copy link
Contributor

@eamanu you can go ahead with the issue. :)

@eamanu
Copy link
Contributor

eamanu commented Jul 30, 2020

@gutsytechster thanks

eamanu added a commit to eamanu/pip that referenced this issue Aug 18, 2020
Any headers from serve are ignored. So, this PR remove
the paragraph that mention that. See pypa#8009 and pypa#5670

Close pypa#8009
eamanu added a commit to eamanu/pip that referenced this issue Sep 7, 2020
Any headers from serve are ignored. So, this PR remove
the paragraph that mention that. See pypa#8009 and pypa#5670

Close pypa#8009
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: cache Dealing with cache and files in it good first issue A good item for first time contributors to work on type: docs Documentation related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants