Reputation: 573
I have a cordova iOS app which simply loads a external url on load. I have configured it in my index.js file as
window.location = "http://mycompany.com/angular_cordova/"
The website is generated using angular and hence the js files embedded in index.html file change every time angular code is compiled. Even after restarting the Cordova app after a new version of website is deployed on server, the app still gets the previous version of index.html. I believe Cordova is caching the webpage. How can we make sure Cordova always fetches the latest version of webpage.
Upvotes: 0
Views: 179
Reputation: 1414
You can add a query string that does nothing to force the app to grab the latest version of the js files. In your index.html if you do something along the lines of <script src="/app/controllers/controller.my_controller.js"></script>
you can change it to <script src="/app/controllers/controller.my_controller.js?version=2"></script>
That should force the browser to use the updated js files instead of the cached ones. Each time you make a change to a file you'll need to increment the ?version number.
Upvotes: 1