Detect if image is in cache
Is there any way to detect if an image is in the cache?
My use case is that I want to do a progressive image loading effect when the image is not cached (fade in on load). However, I don't want the fade when the image is cached, because it is better to just show the image immediately in that case
+1 I'm currently looking for this same solution
+1 I was here for the same use case !
This will be possible once https://github.com/DylanVann/react-native-fast-image/pull/228 is implemented
Please check #351
+1 for this, I'm in the same situation :(
If you want to show up cached images immediately, and show loader on newly images, you can use a temporary hack until it will be improved:
InitialState: isLoading: false
onProgress //set isLoading to true
onLoadEnd //set isLoading to false
onProgress is not getting called even for heavy URL images. Any idea why onProgress wont be called? Am doing some thing like this
<D11Image source={imageSource} onLoadEnd={() => { console.log('onLoadEnd') }} onProgress={({nativeEvent}) => { console.log('OnProgress', nativeEvent?.loaded, nativeEvent?.total) }} />