tags:

views:

326

answers:

2

We are developing a WPF desktop application that is displaying images that are currently being fetched over HTTP.

The images are already optimised for quality/size but there is an obvious wait each time that the image is fetched.

Is there a way to cache images on the client so that they aren't downloaded each time?

+2  A: 

If you're just trying to cache within the same run, then a local dictionary could function as a runtime cache.

If you're trying to cache between application runs, it gets trickier.

If this is a desktop application, just save the cached images locally in the user's application data folder.

If it's an XBAP application (WPF in Browser), you'll only be able to setup a local cache in the user's Isolated Storage, due to security.

Reed Copsey
It is a desktop application. I will put that in the question.
Simon Hartcher
Well, in that case, just save the images in the app data folder for the user...
Reed Copsey
+2  A: 

I have solved this by creating a Binding Converter using the IValueConverter interface. Given that I tried to find a solid solution for this for at least a week, I figured I should share my solution for those with this problem in the future.

Here is my blog post: Image Caching for a WPF Desktop Application

Simon Hartcher