
Historically, all of this work has happened while our users are looking at an inspirational or fun loading message, like this: We cope with that by making heavy use of client-side caching to minimize how much data we have to transfer from our API, but on large enough teams, even that can’t help us completely: at the end of the day, our JavaScript code has to iterate over all of the channels, users, and messages on your team to get them ready for use. However, building that model can be expensive, especially on large teams: each time you load Slack, it has to build that model in memory all over again. Keeping everything in a local model is great for app responsiveness, and it even helps Slack stay usable during service interruptions or problems with our users’ internet connections.

Depending on what information Slack already has loaded in local storage, rtm.start may be able to omit some data - for example, only sending you members who have changed since the last time you were online. This single API call delivers all of the information we need to boot Slack: a complete copy of the model (all of the channels you have access to, all of the members on the team, all of the custom emoji, and so on) as well as a WebSocket URL to connect to for real-time updates. It does this using the rtm.start API method method of Slack’s real time messaging API. It builds a complete model of your team client-side, so using Slack is quick and responsive: whether you’re switching channels, flipping through emoji, or looking at your team-mates profiles, Slack has all of the data it needs on-hand already, which means our users aren’t stuck waiting for API calls to happen before they can do what they want. Slack’s web app is what you’re using if you use Slack from a web browser or one of our desktop apps.


Today, we’d like to tell you about a change we’ve made to Slack’s web app to speed up initial load times - that is, how quickly we go from a blank window to being online and ready to work. At Slack, we’re on a mission to make people’s working lives simpler, more pleasant, and more productive - improving the performance of our products falls into the “more productive” part of that mission.
