# Cordova-app-loader

**URL:** <https://forum.ionicframework.com/t/cordova-app-loader/16090>\
**Category:** uncategorized\
**Created:** [January 21, 2015, 7:23am UTC](https://forum.ionicframework.com/t/cordova-app-loader/16090 "2015-01-21T07:23:12Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![rajatrocks](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rajatrocks/32/7009_2.png) [@rajatrocks](https://forum.ionicframework.com/u/rajatrocks)\
**Post date:** [February 26, 2015, 6:33pm UTC](https://forum.ionicframework.com/t/cordova-app-loader/16090/21 "2015-02-26T18:33:24Z")

</div>

When developing, I didn’t see any issues (and still don’t). I then released my app to both app stores. Deleted my dev versions of the apps and installed the ones from the app stores (on Android 4.4.4 with Crosswalk and iOS 8.1).

**Problem 1:** Pushed new code to the server and neither of the apps on my test devices detected the new manifest. Could not figure out why. Reinstalled dev versions and it all worked fine. Suspected it might have something to do with the app store deployment being different, but generated and manually installed release apk and ad-hoc ipa onto my devices and they worked fine. Also one of my users was prompted to do the update. Never did figure out why this didn’t work.

**Problem 2:** I had added a new template file and updated my main js and css files in the update. When the update was applied on an Android phone, the new template file and js seemed fine. The new CSS did not get applied, so things looked bad. I didn’t see this problem on iOS - the updates were applied properly.

**There is always the possibility that some or all of this was due to a server problem at the time** and that the appropriate data wasn’t being sent down to the app. I’m about to submit new apps to the app stores, and will leave cordova-app-loader in for now and give it another go. I’ll let you know how it goes.

If I can’t get it working, it appears that application cache for “hot code push” is a viable way to go. Here’s what I’ve learned:

There’s a nice description of how @mikemintz implemented it here:

> [@What are you building with Ionic? We want to know!](http://forum.ionicframework.com/t/what-are-you-building-with-ionic-we-want-to-know/12244/130):
>
> Thanks @iqlas! For the webapp, we pretty much just have the webserver serve the www folder. We created a separate cordova hook to add \<script src="cordova.js"\>\</script\> so that it won’t attempt to load in the webapp. Anytime we use a cordova plugin, we have graceful degradation. E.g. for toast messages, if window.cordova exists, call $cordovaToast.showShortBottom; otherwise, use jqlite to create an absolute position div and $timeout to destroy it after a few seconds. For the appcache, we did …

and described by @SidneyS here:

> [@Updating Ionic Apps on the fly](http://forum.ionicframework.com/t/updating-ionic-apps-on-the-fly/1577/4):
>
> Its really easy, i’ve done it in production for a large corporation. Thats also how Financial Times updates their webapp inside their native wrapper. develop as usual use grunt-manifest to automate creating an appcache manifest file point index.html to remote host instead of local machine, place all assets on remote host on first launch, the app will download the app remotely and as soon as you update one of the files on the remote server, it will be updated in the webapp. boom - store-indepe…

More details on application cache:

- [অ্যাপ্লিকেশন ক্যাশে ব্যবহার করার জন্য একটি শিক্ষানবিস গাইড &nbsp;|&nbsp; Articles &nbsp;|&nbsp; web.dev](http://www.html5rocks.com/en/tutorials/appcache/beginner/)
- [http://appcache.offline.technology/](http://appcache.offline.technology/)
- [Application Cache is a Douchebag – A List Apart](http://alistapart.com/article/application-cache-is-a-douchebag)

**Notes:**

- uses built in browser functionality - good
- You need to put all the cordova and cordova plugin files on your server as well as your app files, and have different versions per platform. Something like this from @andrewreedy could help: [https://github.com/andrewreedy/cordova-loader](https://github.com/andrewreedy/cordova-loader)
- it appears that you don’t need to package any of your app code into your binary (which makes the binary lighter), but on first run (and until all the files are cached), you will be running your app from the server, and all the files will be downloaded and cached in the background
- if any of the files listed in CACHE can’t be retrieved, the entire cache is disregarded
- I had thought that it re-downloaded everything in the manifest, but according to the second link above - _“When updating an existing appcache, the browser sends standard If-Modified-Since headers, so it skips re-downloading files that have not changed.”_ which is nice, although in practice you’re probably uploading newly generated versions of the files, even if they haven’t changed.

---

_[View the full topic](https://forum.ionicframework.com/t/cordova-app-loader/16090)._
