NuGetPackageExplorer icon indicating copy to clipboard operation
NuGetPackageExplorer copied to clipboard

Enhance ImageCache for url matching

Open clairernovotny opened this issue 6 years ago • 4 comments

Currently the cache key for the package icons in IconUrlToImageCacheConverter is the url. Now that NuGet.org maps and stores a private copy of the images, we can't assume that the image url from the metadata matches the image url from the package.

We should update the cache key mechanism to key off of the package id and version so that we get the same cache result regardless of whether we open from the metadata url or from the package url for a particular package id/version combo.

clairernovotny avatar Nov 09 '19 22:11 clairernovotny

Changing the icon URL of an existing package wouldn't update the image displayed in the package viewer in this case. So the image object cache would need to be invalidated for that identity.

campersau avatar Nov 10 '19 00:11 campersau

True, but maybe we can add another input to the multi binding and use it to eject that item from the cache in that mode?

Another idea is that local URL's, or urls for things that'd be within the package/filesystem, aren't cached at all as the assumption would be that it'd be fast enough to load again on-demand.

clairernovotny avatar Nov 10 '19 02:11 clairernovotny

@campersau is this still an issue?

clairernovotny avatar Apr 02 '20 16:04 clairernovotny

Yes, I think so. When opening a NuGet package which uses an IconUrl we currently store two cache entries for them, one with the nuget.org URL and one with the original IconUrl from the metadata.

campersau avatar Apr 18 '20 11:04 campersau