Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Remote images cache problem with embedded javascript bundle #8

Closed
halilb opened this issue Jun 22, 2016 · 2 comments
Closed

Remote images cache problem with embedded javascript bundle #8

halilb opened this issue Jun 22, 2016 · 2 comments

Comments

@halilb
Copy link
Owner

halilb commented Jun 22, 2016

Working scenario:

  1. Clone the repo
  2. Open Examples folder cd react-native-photo-browser/Example
  3. Checkout cache_test branch git checkout cache_test
  4. Run npm install
  5. Open Example project with Xcode ios/PhotoBrowserExample.xcodeproj/project.pbxproj
  6. Open ios/PhotoBrowserExample/AppDelegate.m file and change jsCodeLocation value using the IP address of your machine.
  7. Run the app on your device.
  8. Select "Multiple Photos" option when the app starts.
  9. Wait for the images to load.
  10. Check Settings->General->Storage->Manage Storage->PhotoBrowserExample and note "Documents&Data" usage of the app. It should be around 38.4 MB.
  11. Close the app and relaunch a few times. You'll see all photos initially available from cache.

Problem scenario:

  1. Delete the app from your device.
  2. Create javascript bundle file react-native bundle --minify --entry-file index.ios.js --platform ios --bundle-output ios/main.jsbundle
  3. Open ios/PhotoBrowserExample/AppDelegate.m file. Remove the comment characters from line 44.

Now repeat all the steps between 7 and 11. You'll see that images will be reloaded after every time you relaunch the app. You'll see that the app's storage usage will go like 1 MB from 38.4 MB.

I tried removing dev mode, building the app with release option but none of them helped. I can see http cache headers in flickr http responses.

Notes:

  • I can't reproduce the problem when cached image storage is below 10 MB.
  • Tried on react-native versions 0.27.2, 0.26.3 and 0.25.1.
  • Tried changing image url protocols to http.
@halilb
Copy link
Owner Author

halilb commented Aug 29, 2016

I tested the problem with react-native 0.32 and it's still there.

@halilb
Copy link
Owner Author

halilb commented Jul 24, 2017

I don't experience the problem with recent react native versions.

@halilb halilb closed this as completed Jul 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant