Skip to content

Follow-up to #2984: dealing with old HTTP download caches #12082

@itamarst

Description

@itamarst

What's the problem this feature will solve?

Once #11143 is merged, new versions of pip will use a new HTTP on-disk cache. Old versions will continue to use the old cache, which resides in a different directory.

There is a point in time where that old cache really ought to be deleted. For example, after 5 years essentially no one should care about the old HTTP cache, but anyone who keeps around the same home directory will now be wasting disk space. The more time passes, the less likely the old HTTP cache is in broad use by users.

Describe the solution you'd like

As discussed in #11143, after N(==2 to match deprecation policy?) releases or perhaps a certain amount of time, it will become reasonable to assume that most users on the latest version of pip have stopped using older versions of pip, and therefore the old HTTP cache can be cleaned up.

Potential solutions:

  1. Warn the user, with instructions on how to clean the cache. "You are using X MB in the old HTTP cache, which is only used by versions of pip older than 2023.X. If you are only using new versions of pip, you can clean the cache by doing pip clean --old-http-cache". (I made that command up, just pretend it's the correct command).
  2. Automatically delete the whole old cache.
  3. Heuristics! Automatically delete items in the old HTTP cache that haven't been modified for more than a certain amount of time, on the presumption that they're not relevant (presumably new releases have come out as well). Eventually it will just be empty.

Options 1 and 2 probably imply some future issue to rip the code out when it's assumed most users don't have old HTTP caches anymore.

Option 3 is attractive in that essentially the same code could be applied to the new HTTP cache, so it would be helpful for not having infinitely increasing caches which is currently possible.

Alternative Solutions

N/A

Additional context

N/A

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: cacheDealing with cache and files in itstate: needs discussionThis needs some more discussionstate: needs eyesNeeds a maintainer/triager to take a closer looktype: feature requestRequest for a new feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions