3 ms·
I'd be interested to see how the offline capability of Gmail ties into this. Whatever it uses, localstorage or service workers or whatever, it does a pretty dan
by pathartl 8y ago
I'd be interested to see how the offline capability of Gmail ties into this. Whatever it uses, localstorage or service workers or whatever, it does a pretty dang good job.
- chrismorgan 8y agoI can’t speak about how Gmail’s offline functionality works, but I would expect it to be broadly similar to the basic approach we’re planning on in FastMail, which is that you start by simply adding a persistent cache. There’s already a robust object syncing protocol in place (JMAP), and you already have what amounts to simple tables (Mailbox, Email, CalendarEvent, &c.), so all that’s really changing is that you’re moving most of that cache onto disk rather than keeping it in memory. Most likely, content is moved out of the JS heap into an IndexedDB. I’m not sure what the memory characteristics of IndexedDB are yet, but at least theoretically that should be memory that can easily be freed, because it’s all flushed to disk. There’s the possibility that the browser may keep more in memory than is necessary, but I would actually expect memory to be a little lower in the presence of service workers, rather than higher.