NuGet/Home

A better cache clean-up and expiration policy

Open

#4,980 opened on Apr 5, 2017

View on GitHub
 (42 comments) (57 reactions) (0 assignees)HTML (1,459 stars) (292 forks)batch import
Area:HttpCachingCategory:Quality WeekPriority:2Type:Featurehelp wanted

Description

edit by @zivkan: a first step has been implemented, allowing package "last used in restore" date to be updated: https://github.com/NuGet/NuGet.Client/pull/4222

edit by NuGet Client Triage:

  • Restore driven - A minimally impactful approach might be to run a "gc" periodically, like say once a week or once a month.
  • Additional command - Community projects like NuGet Cleaner combine with updatePackageLastAccessTime

original post below:


The user local NuGet cache has a tendency to grow unconditionally. Which results in funny tweets like this from @davidfowl:

David Fowler‏ @davidfowl 9m How big is your nuget cache? Mine is 14 gigs #nuget image

Can we track when an item was last hit by package restore and apply some expiration policy? I don't have good data, but I bet a good chunk of the bloat aren't individual packages with a single version but a small number of packages with many versions. If were to just delete older versions that weren't needed for restore for a while, we're probably getting to something saner.

Thoughts?

Contributor guide