react-native-fast-image: iOS - Caching Image failures
I am loading 20 images hosted in the USA on a very slow wifi connection (less than 1Mbps) from Asia. In the browser, the images fetch, but its slow.
It seems that FastImage, if the image loading fails (onError is triggered), caches the error instead of trying again later. So when I reload the app, it does not try to refetch the failed images. Only deleting the app and re-launching it again will FastImage be able to fetch the images again.
I don’t know iOS / Swift well enough to confirm my hypothesis, but is anyone else seeing this?
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 5
- Comments: 18 (9 by maintainers)
I’m still getting cache misses and/or poor image loading with your fork. Images don’t or take a long time to load with excellent internet. There is definitely a lot less memory being used! Thank you so much for the work so far! It’s definitely an improvement and using your fork is still way better than using React Native Image or the current version
@KevinColemanInc I think I am experiencing the same issue as you.
You are indeed right, I investigated the issue and right now on iOS when the “ImageCanvas” (I will call it like this) fail to download an image. Well first it fail silently, the error isn’t broadcasted to the RN side, and second it won’t try to download the image again.
So my issue is a bit different than yours. I notice this because in my app I have the same picture being display on several screen, and sometime it loads in some screen but not in others.
e.g I have “ImageCanvas1” on page 1 who failed to download the image, then I push page 2 with “ImageCanvas2” who load successfully the picture. When I pop back to page 1 “ImageCanvas1” still haven’t loaded the picture.
So I have fixed my issue on my own branch but haven’t submit a PR for it yet. Also it’s an iOS related issue, this doesn’t reproduce on Android as Glide will automatically re-trigger the download if it fails.
But as I said your issue is different, and I should made a fix that handle all the scenario.
I will open a new PR for this, and will keep you updated about it.