-
Notifications
You must be signed in to change notification settings - Fork 252
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
NuGet command to purge/clean cache #2308
Comments
This is already supported: nuget.exe locals -clean all (and more goodies https://docs.nuget.org/consume/command-line-reference#locals-command) We will also add it to xplat/.net cli eventually |
I know there's a clear command. This was to sta suggest ways to make it more selective than a full purge. For many users, downloading everything is expensive and slow. Now they need to reclaim disk too. |
I was reading this as an option
Touching is a bad idea, build systems rely on the dates not to change, so nuget can start managing a separate cache here
That's a bit of an unreasonable assumption, I don't see the relationship, this will for example delete the .NET packages which is one of the biggest package sets. So I'm open to more discussion here, and if something can be done to make it better, all for it. But I don't want to add unnecessary complexity and tooling for something relatively trivial like this with a clear strong benefit that can be explained. |
Good point about the delete all - I didn't realize 3.3 had that. I supposed the real potential gain is selective cache trimming. That would help those with slower and/or metered connections the most. For my second idea, how would touching a file in the cache dir affect a build system? I would propose adding a |
That's works. Will need to validate that this doesn't slow things down. This could be a nice addition when we break the surface of the water we are under or a cool pr |
The cache management is currently only accessible from the command-line. Can we add this feature into the powershell console and a button in the NuGet settings dialog? |
@csharpfritz that's ready tracked as a separate issue |
Hi Yishai I would not raise this as an issue, if there was an easy workaround , but I really hate misbehaved applications. If you set readonly attributes on a server, it is usually because you want to preserve something . Now n a DevOps environment it is not uncommon to maintain fusions or even hundreds of builds, and the current nugget behaviour is a hindrance of that, and it costs us many hours of download time every day. Honestly I find your dismissal of my request offensive. I want to use your software, it can help my organisation a lot, but I'm asking for a way to solve what I would consider a serious misbehaviour. Kind regards |
I'm suggesting that there is a new mechanism to use nuget that resolves your issue (or most of it) and that this current old mechanism is an area we don't want to keep evolving. Because it has numerous limitations and by investing in it we delay progress in the area where we see the most benefit to the bulk of the community. This is why I linked to an issue that covers a very similar ask. At the same time we would be glad to help you tweak your existing process and optimize it so you don't lose time/effort. If you'd like please email us on feedback@nuget.org and we will work with you on making your process better. |
closing this one...in favor of the similar #4980 |
The shared package cache right in v3 is more hidden than the solution-based location in previous versions. This can make it much easier to accumulate older cruft over time. Selectively cleaning the cache is painful too because of how many folders there are.
NuGet could be smarter about this and provide options for pruning the main package cache. Some ideas:
touch
on unix, race conditions don't matter here, just use latest). Then a prune could easily have a "not used in the past month" switchThe text was updated successfully, but these errors were encountered: