jamesmontemagno / ImageCirclePlugin

Circle Images for your Xamarin.Forms Applications
MIT License
239 stars 68 forks source link

Invalidate the image cache #76

Closed vd3d closed 5 years ago

vd3d commented 5 years ago

Hi,

I use the CircleImage in my app. to show the user profile picture, but when I upload a new "user profile" picture on the server and try to update the image with the new version (Noticed that the image uri is the same), it is still the same _

I have search for a way to invalidate the cache, but none of the solution I use work ! Even when I restart the application I get the old version of the image.

Here is my code :

(MediaImageSource as UriImageSource).CacheValidity = new TimeSpan(-1); FFImageLoading.Forms.CachedImage.InvalidateCache(MediaImageSource, FFImageLoading.Cache.CacheType.All, true); FFImageLoading.ImageService.Instance.InvalidateCacheAsync(FFImageLoading.Cache.CacheType.All);

I haven't find anything about caching on the ImageCircle, but it will be really useful :-)

Any idea ?

Thx

jamesmontemagno commented 5 years ago

You would have to use the underlying caching in xamarin.forms: https://montemagno.com/xamarinforms-image-caching-in-xaml/

I don't do anythign special.

Also FFImageLoading lets you do circles.