title: Firebase offline cache & original firebase.js source code
body: <p>My question is a follow-up to <a href="https://stackoverflow.com/questions/14670394/does-firebase-allow-an-app-to-start-in-offline-mode">this topic</a>. I love the simplicity and performance of Firebase from what I have seen so far.</p>
  
  <p>As I understand, firebase.js syncs data snapshots from the server into an object in Javascript memory. However there is currently no functionality to cache this data to disk.</p>
  
  <p>As a result:</p>
  
  <ol>
  <li>Applications are required to have a connection when they start-up, thus there is no true offline access.</li>
  <li>Bandwidth is wasted every time an app starts up by re-transmitting all previous data.</li>
  </ol>
  
  <p>Since the snapshot data is sitting in memory as a Javascript object, it should be quite trivial to serialize it as JSON and save it to localStorage, so the exact application state can be loaded next time the app is started, online or not. But as the firebase.js code is minified and cryptic I have no idea where to look.</p>
  
  <p><a href="http://pouchdb.com" rel="nofollow noreferrer">PouchDB</a> handles this very well on a CouchDB backend. (But it lacks the quick response time and simplicity of Firebase.)</p>
  
  <p><strong>So my questions are:</strong></p>
  
  <p><strong>1. What data would I need to serialize to save a snapshot to localStorage? How can I then load this back into Firebase when the app starts?</strong></p>
  
  <p><strong>2. Where can I download the original non-minified dev source code for firebase.js?</strong></p>
  
  <p>(By the way, two features that would help Firebase blow the competition out of the water: offline caching and map reduce.)</p>