Stop image caching in wP7

I have a function that displays images from an attached uri (e.g. www.website.com/picture1.jpg).

I found and now understand that the phone caches downloaded images. I read that this is only for the life of launching the application, but even when I close the application and return back, the same images from the cache appear. Is there any way to stop this caching at all for this particular page?

EDIT: Images are updated regularly, but still have the same name, so there’s no need to cache. For example, think about camera security.

Many thanks.

+3
source share
5 answers

, uris GET i.e.

var imageUrl = "www.website.com/picture1.jpg";
var imageUri = new Uri(String.Format("{0}?{1}", imageUrl, Guid.NewGuid()));

- GET Uri HTTP - - . , - JSON-RPC...

, , , . , , , , .

+5

URL . (, DateTime.Now)

+2

CreateOptions BitmapImage ( ), BitmapCreateOptions, IgnoreImageCache: Loads . , .

, , ... , .

+1

, ; , HTTP-? , ().

.

0
source

Cache is good, because in your case it can save on image loading, if the image has not changed, why should it be downloaded again?

if your image has been resized and you want to force it to download it again, you can create a unique identifier in the url.

but think about it, why?

-1
source

Source: https://habr.com/ru/post/1791778/


All Articles