Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benefits of using this against just the <Image> component #5

Open
Naoto-Ida opened this issue May 25, 2016 · 5 comments
Open

Benefits of using this against just the <Image> component #5

Naoto-Ida opened this issue May 25, 2016 · 5 comments

Comments

@Naoto-Ida
Copy link

Doesn't the Image component have a caching mechanism?
I'm interested in boosting my app's performance, wondering if anybody had some insight into
this form of caching.

@sharq1
Copy link

sharq1 commented May 30, 2016

@Naoto-Ida thank you for bringing this up - I was having problems with react-native-cache-image and I had no idea there is preload functionality for native Image component.
It looks to me, that with react-native-cache-image you get much more control over caching (by modifying consts in storageMgr.js), while you cannot do that with native Image.
I wonder whether if user hits 'Clear temporary data' system-wide it will clear preloaded images (native)? With react-native-cache-image it surely won't.

@Naoto-Ida
Copy link
Author

Thanks for the info.

I'm kinda wondering how the performance benefits are with this caching.

@folivi
Copy link

folivi commented Jun 21, 2016

does anyone have a code sample of the use the preload method?

@axe312ger
Copy link

Looks like react native can now do it on its own:
facebook/react-native@f7bcb3e

@vovkasm
Copy link

vovkasm commented Oct 15, 2016

@axe312ger : As I can see, RN (at least latest tagged v0.36.0-rc.1 for iOS) do not deal with disk cache, it uses simple NSCache object to cache image data in-memory (RCTImageCache.m#L35). Moreover, it resets cache not only on memory warning, but also every time when user switched to other app (RCTImageCache.m#L47).

Or I am wrong?

In any case, personally I will use this component as a base for our application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants