The Buddycloud web client is available on github. I started with the Diaspora-x codebase, and have been backporting in features from the codebase that was started by Stefan Maka (another Buddycloud contributor).

Channel metadata display

Using localStorage to accelerate load time

When you fire up diaspora-x, it takes about 15 seconds to finish loading the #home page. Obviously this isn’t going to play in a world where page loads should take less than 1000ms. Ideally I’d like the page to load in about 100ms. Assuming we can get everything cached locally, that gives a pretty generous time for the browser to cache and run the javascript payload.

The first part of the optimization was to prevent unnecessary requests to the XMPP server. Once you’ve requested all a users posts, there’s no need to re-request the same posts. We can use Result Set Management to only ask for posts newer than the last post we recieved, and then we can use backbone-localStorage to save the posts in localStorage in the current browser.

class ChannelCollection extends Backbone.Collection
  model: Channel
  
  initialize: ->
    @localStorage = new Store("ChannelCollection")

And then before we start the app…

Channels = new ChannelCollection
Channels.fetch()

Then remember to clear localStorage when the user logs out.

localStorage.clear()