Open rowinbot opened 6 years ago
The main advantage of this package is that it does more aggressive caching.
If you want to clear the cache every time then you may as well just use Image
. In your case I think it would be better to add a cache control property for that specific image.
How do I so?
A cache control property isn't currently a feature but I'm open to PRs. It would be better than clearing the whole cache each time.
As far as an immediate solution for you:
Image
.FastImage
, but manually bust the cache yourself using a query parameter (uri: http://example.com/example.png?bust=123
, where you change 123
each time you need to bust the cache).I think either of those would be fine.
@DylanVann What about implementing a method for busting the whole cache (for development environments).
http://bumptech.github.io/glide/doc/caching.html#clearing-memory
// This method must be called on the main thread.
Glide.get(context).clearMemory();
Maybe instead of using url-manipulations, there should be some API where the developers can trigger these cache-purges themselves 😃 of course with a lot of "you might not want to use this"-warnings around 😸 I'm actually fighting against some caching-issue where I want to use this library, but have no control over the HTTP headers the server is sending to me, therefor when having a cached image, and via a different workflow change that image (like profile-image upload in my app), the URL stays the same, so having a way to evict that image from cache, should be available (I think).
I'd be open to adding:
FastImage.cacheControl.none
- https://github.com/DylanVann/react-native-fast-image#sourcecache-enum@DylanVann #425
I'd be open to adding:
FastImage.cacheControl.none
- https://github.com/DylanVann/react-native-fast-image#sourcecache-enum- APIs for Android and iOS to clear the entire cache.
Thanks, it would be nice to see these features! Is #425 of @guhungry good?
I'm having issues because fast-image cached invalid images during an s3 outage and now won't download the correct versions unless the url changes, which it won't because the url I use redirects to the real url, so I can't do the bust parameter approach. I would love a way to clear all cache.
I'd be open to adding:
FastImage.cacheControl.none
- https://github.com/DylanVann/react-native-fast-image#sourcecache-enum- APIs for Android and iOS to clear the entire cache.
Any update, i having problem with caches too
A cache control property isn't currently a feature but I'm open to PRs. It would be better than clearing the whole cache each time.
As far as an immediate solution for you:
- Use
Image
.- Use
FastImage
, but manually bust the cache yourself using a query parameter (uri: http://example.com/example.png?bust=123
, where you change123
each time you need to bust the cache).I think either of those would be fine.
if my query params changes will it bust the cache of that particular image automatically or we have to do manually ? if manually how to do that.
Why no answer like that?
FastImage.clearDiskCache(); FastImage.clearMemoryCache();
I was here for a little while wondering how in the heck do I clear the cache during development. I initially thought @thangpq that your response was saying, that these methods SHOULD exist and it took me a minute to realize they do exist!
Long story short, after a careful read through IMHO this issue could be closed. Thanks for the library! Been super helpful in our app.
Why no answer like that?
FastImage.clearDiskCache(); FastImage.clearMemoryCache();
This actually worked for me
Hi, I've seen a lot of issues around here about the cache, but I'm having issues with an app I'm developing, when you are able to log in, have a home screen with your avatar, but then when you change the avatar (it keeps the same url, only the image itself change) it doesn't reload because of the cache. I'm not able to provide inmutable url so currently don't know what to do, any help please?
It would be great if you provide a method to clean cached images so I can call it when the user logs out or re-run the app.