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

pip: disable cache for modified response #793

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

VincentVanlaer
Copy link
Contributor

The pypi proxy filters packages, which can end up corrupting the pip cache. For an example of what this would look like, see pypi/warehouse#14457

@DavHau
Copy link
Member

DavHau commented Nov 19, 2023

This seems to impose a significant performance bottleneck. With large closures re-fetching everything all over again on each lock update is quite expensive considering that some python packages are several 100MB in size.

While I'm aware that fixing the bug is more important than performance, I wonder if there are alternatives. Could we just remove the versions from the response as well and fix the inconsitency thereby?

The pypi proxy filters packages, which can end up corrupting the pip
cache. For an example of what this would look like, see
pypi/warehouse#14457 This commit prevents the
the cache from storing our modified response by adding a 'Vary: *'
header. Judging from the caching code, this is the least intrusive
approach to prevent caching ('Cache-Control: no-cache' deletes existing
caches for example).
@VincentVanlaer VincentVanlaer changed the title pip: disable cache completely pip: disable cache for modified response Nov 19, 2023
@VincentVanlaer
Copy link
Contributor Author

VincentVanlaer commented Nov 19, 2023

Did some digging in the pip source code, found a way to disable the cache only on the modified responses.

@DavHau DavHau merged commit 427b5e9 into nix-community:main Nov 20, 2023
202 checks passed
@VincentVanlaer VincentVanlaer deleted the pip-no-cache branch November 20, 2023 08:00
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.

None yet

2 participants