-
Notifications
You must be signed in to change notification settings - Fork 467
Question about the iOS app reload: drop cache after update installation #47
Comments
Are you using local development add-on, or you are testing with the real server? |
I am testing with real server, I have tried different configurations
|
Is it Cordova or Ionic project? And on what platform you are testing: iOS or Android? |
I tested on iOS only, I have some own code build between cordova and ionic. the update works after I restart app 2 times, seems its not applied before I manually restart the app. |
That's strange. Will try to reproduce that. Just of curiosity: if you will try to use local development add-on - problem remains, or everything works? Let him do all the work. You can look into the docs on how to use it. |
I set "update": "now" in chip.json, set in config.xml, reload index.html when updateInstalled event is triggered. A question would be is it possible to apply the change directly, or restart the app automatically, (what I did to restart is just reload index.html, maybe its not enough.) |
the change I did is just a very minor text change on one of the ionic page template. |
Well, it should reload the page automatically when the update is installed. But for some weird reason, in your case, it doesn't... Will investigate. |
I tried both iOS emulator and IOS phone, I run 8.4 my chcp.json |
Can someone guide me what is the correct configuration if expect app to reload with new update without manually restart app? |
Hello, I am looking through some code and try to understand, can you give me a guide on where the app is reloaded after installation success? do you restart the web view or? I was thinking if there is some cache involved when do a refresh of the url in cordova. |
Ok, found where it reloads the page. |
Tested some more, it seem the file in Library/Application support is updated, but in the running instance of the app, it still loads the old file. |
I read somewhere iOS has trouble clean cache for web view for local html. this doesn't sounds good:( |
http://stackoverflow.com/questions/2523435/how-to-clear-uiwebview-cache don't know if this link helps, but it does seem there are no really good solution to this... |
Well, I am temporary solving it by always load js and html with timestamps, but it will be really nice if somehow the web view cache can be totally cleaned. |
+1 I also encountered the same problem. Steps:
|
I think the problem is based on all js, css, img resources is still cached when you reload web view, so a workaround will be always load resources with timestamp. example src="xxxx.js?23948uioew098" If you are using requirejs, there is a parameter you can set in config that always load files with an extra param, |
Yes, the problem is with iOS and how WebView caches css and js files. I use one dirty hack to solve it, it worked before. But for some reason it's not working for you... As a workaround - yes, you can add some random query parameter to the js and css files, as you showed. I read http://stackoverflow.com/questions/2523435/how-to-clear-uiwebview-cache before, tried hacks from there, but didn't really helped. Will continue to search for better solution on that. |
In v1.2.0 I have changed the way on how web files are stored. Now each release has it's own |
@dongdh wrote in #18:
The text was updated successfully, but these errors were encountered: