Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Add a dnu command to clear the HTTP cache #2401

Closed
DamianEdwards opened this issue Aug 3, 2015 · 5 comments
Closed

Add a dnu command to clear the HTTP cache #2401

DamianEdwards opened this issue Aug 3, 2015 · 5 comments

Comments

@DamianEdwards
Copy link
Member

dnu caches results for the various categories of HTTP requests it makes (e.g. feed check, list package, v3 feed check, etc.) for various amounts of time.

While it's possible to run a dnu restore at any time with the cache disabled via --no-cache, there isn't a way to clear the cache completely, other than just deleting the folder in the user profile.

Propose we add a command to clear the HTTP cache, e.g. dnu --clear-cache. Might be nice to support clearing it only for specified feeds too, e.g. dnu --clear-cache https://www.myget.org

This hit me today as we found an issue in the NuGet v3 feed root index.json file which is now fixed. However, dnu caches the request to that file for a week, so customers will need to manually delete the cache folder to see the change in the meantime.

@glennc glennc added this to the 1.0.0-beta8 milestone Aug 4, 2015
@glennc
Copy link
Member

glennc commented Aug 4, 2015

Assigning to beta8 for at least the clear-cache command, we will talk about clearing a specific URL but we might punt that part to beta8

@MisterJames
Copy link

@glennc I could take this one on if you like.

  1. Can I assume that a raw dnu --clear-cache would clear out the DnuFolderPath.HttpCacheDirectory folder entirely? Or should it clear the list_ and nupkg_ but preserve the dir structure and leave the index_json.dat?
  2. When clearing for a specific feed, would https://www.myget.org match all entries in the cache with the start of that domain? Or would it be only on direct matches such as https://www.myget.org/F/aspnetvnext/api/v2/ or https://www.myget.org/F/roslyn-nightly/?

@glennc
Copy link
Member

glennc commented Aug 24, 2015

I had assumed it would nuke the whole folder. But I am not familiar enough with the entire mechanism to say for certain. @davidfowl @anurse @lodejard What do you guys think?

@MisterJames
Copy link

@glennc Whole folder for the base scenario, yes. But @DamianEdwards had said:

Might be nice to support clearing it only for specified feeds too, e.g. dnu --clear-cache https://www.myget.org

@muratg
Copy link
Contributor

muratg commented Sep 24, 2015

Done: 3d0edc0

@muratg muratg closed this as completed Sep 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants