Why is BitmapImage RequestCachePolicy ignored?

I find that setting the property RequestCachePolicyto BitmapImageno effect on how the loaded bitmap, if the instance is BitmapImageinstalled Image Source.

For example, if I installed RequestCachePolicyin CacheOnly, I would not expect that no Internet traffic would happen - the specified image should be extracted only from the cache. But instead, I see a server request to upload an image:

source = new BitmapImage(bmi.UriSource, 
  new RequestCachePolicy(RequestCacheLevel.CacheOnly));
// An image gets downloaded!

If I set the static property DefaultCachePolicyto HttpWebRequest, then the behavior of my application will change as I expected. those. when it is set to CacheOnly, network traffic does not occur.

Why property RequestCachePolicyon BitmapImagehas the desired effect?

+5
source share
1 answer

According to MSDN website: http://msdn.microsoft.com/en-us/library/system.net.cache.requestcachepolicy%28v=vs.110%29.aspx

"Caching for web services is not supported."

0
source

All Articles