package cache clean-up policy

Oct 12, 2011 at 4:31 AM

I am led to believe the current package cache cleanup policy is 

"When we hit 100 delete them all"

Would people like a smarter policy?

I was thinking 

"When we hit 100 delete the 10 oldest packages"

Package age could be kept on the package files themselves by using File.SetLastWriteTime each time a package is applied to a project.


Oct 12, 2011 at 4:50 AM
10 oldest? Or 10 that have not been installed recently?

Are you proposing to send a pull request with the change if we agree on it? :)
Oct 12, 2011 at 4:52 AM

If we're going to do that, we may as well do a pure MRU and have the new one replace the least recently used instead of wacking 10 at a time...

The current logic was probably done to keep things simple so we don't need to keep track of when things get installed.

Oct 12, 2011 at 5:08 AM


Yes I will do a pull request.

I just need to know the specifics of how you want it implemented.

"10 oldest? Or 10 that have not been installed recently?"  this will be the same thing if each time a package is installed we set the "last write time" on the cached file. unless I am missing something??


Ok that sounds better

Oct 12, 2011 at 5:10 AM
What Ebbo said. But we don't currently store that info, so you'll need to figure something out for that.
Oct 12, 2011 at 5:14 AM

does "NuGet Package Explorer" store packages in the same cache?

Oct 12, 2011 at 5:16 AM

yes, it does.