Further Appcache Research
http://www.html5rocks.com/en/tutorials/indexeddb/todo/
http://grinninggecko.com/2011/04/22/increasing-chromes-offline-application-cache-storage-limit/
http://www.html5rocks.com/en/tutorials/offline/quota-research/
https://developers.google.com/chrome/apps/docs/developers_guide?csw=1#installing
https://developers.google.com/chrome/apps/docs/developers_guide?csw=1#manifest
The first thing to do when taking your Meteor app offline is to create some visual indication of whether the local client app is connected to the server or not. There are lots of ways to do this, but the simplest way is to probably do something like this:
Template.registerHelper('getOnlineStatus', function(){ return Meteor.status().status; }); Template.registerHelper('getOnlineColor', function(){ if(Meteor.status().status === "connected"){ return "green"; }else{ return "orange"; } });
<div id="onlineStatus" class="{{getOnlineColor}}"> {{getOnlineStatus}} </div>
.green{ color: green; } .orange{ color: orange; }
One of the easier steps is adding the appcache. Appcache will allow your application content to load even when there is no internet access. You won't be able to get any data from your mongo servers, but the static content and assets will be available offline.
meteor add appcache
Finally, we want to get some of our dynamic data to be stored offline.
meteor add ground:db
Lists = new Meteor.Collection("lists");
GroundDB(Lists);
Todos = new Meteor.Collection("todos")
GroundDB(Todos);