How to clear the image cache in a Silverlight desktop application

John McCann picture John McCann · Jul 28, 2011 · Viewed 17.4k times · Source

I'm running a Silverlight out-of-browser desktop application that downloads a bunch of images from an HTTP server. It seems as though Silverlight has a local image cache that it uses for the images, even across multiple instantiations of the application. If I update an image on the HTTP server, I would like the updated image to be displayed in the Silverlight application, rather than the version of the image stored in the Silverlight image cache. How do I go about clearing the image cache on my machine?

Clearing my web browser's image cache doesn't work here because the Silverlight application is running as an out-of browser desktop application.

Note: I'm not interested in clearing the cache programmatically, I want to be able to do this by either changing a setting on my machine (to disable the image cache) or deleting a directory where the images are stored.

Answer

Mike Pedersen picture Mike Pedersen · Sep 13, 2012

To clear the Silverlight cache, use the following steps:

1) Start up the Silverlight application of interest

2) Right click anywhere inside the application and click ‘Silverlight’

3) Click on the “Application Storage” Tab

4) Choose the application (website) of interest and click "Delete..."

-or-

4) Click "Delete All" to delete the cache for all Silverlight applications

If you don't want applications to ever cache, clear the "Enable application storage" checkbox, but this is not necessarily recommended.

http://www.microsoft.com/getsilverlight/resources/documentation/AppStorage.aspx