pxview
pxview copied to clipboard
PXCacheImage is not using cache
https://github.com/alphasp/pxview/blob/6e7cc473746ea0fd07e906d2757200cd788674f6/src/components/PXCacheImage.js#L71
I see you download the image into the cache folder, and then calculate the size, finally using the origin uri in the Image component. Which means we have the image downloaded twice.
I'm not sure if this is a typo...
In this component, react-native-fetch-blob
is use to download images and get images size because the react native Image getSize
method is not supporting passing custom HTTP headers.
Images size is required to fit images in Illust Detail nicely.
The reason that I render Image
with the source uri instead of the downloaded image path is because the performance is bad and images sometimes getting stuck when rendering.
I have implemented a simple cache for PXCacheImage component like this: /src/components/PXCacheImage.js
And I cannot comfirm the performance issue you said, it works well. Maybe you should upgrade the react-native to 0.50.3.