title: Using Firebase JS SDK offline capability vs promises to cache data?
body: <p>We are trying to design an web app that needs to be frugal with consuming network. And we are using Firebase.</p>
  
  <p>Firebase JS SDK claims it has offline capability, but this example uses promises to cache user data. 
  <a href="http://jsfiddle.net/firebase/jgay49r0/embedded/result,js/" rel="nofollow">http://jsfiddle.net/firebase/jgay49r0/embedded/result,js/</a> </p>
  
  <p>It seems offline capability makes this promises based UsersCache redundant.</p>
  
  <pre><code>function UsersCache( refToUsersPath ) {
     this.ref = refToUsersPath;
     this.userPromises = {};
  }
  
  UsersCache.prototype.getUser = function(userId) {
     if( !this.userPromises.hasOwnProperty(userId) ) {
        this.userPromises[userId] = this._monitor(userId);
     }
     return this.userPromises[userId];
  };
  
  UsersCache.prototype._monitor = function(userId) {
     var def = $.Deferred();
     this.ref.child(userId).on('value', function(snapshot) {
        def.resolve(snapshot.val());
     });        
     return def.promise();
  };
  </code></pre>
  
  <p>Can someone comment and help us choose the best path?</p>