Factors that affect tab loading speed

The loading speed for tabs varies a lot depending on geographical location and the quality of a person’s connection to the internet. Typically, slow loading times are caused by (1) slow loading external assets used in a tab, like external stylesheets, scripts, or images, or (2) Facebook.

Loading a tab follows this process:
1. Main Facebook interface loads.
2. Facebook loads a proxy redirector in the tab iframe.
3. Iframe loads initial page from our server
4. That page has a redirect, which loads a second page from our server. This is the actual content of the tab.
5. All external assets specified in the head of the tab must load before the tab is displayed.

Step 4 is necessary to stop certain kinds of spammers from abusing the app.  Fortunately it only adds about 100 milliseconds or so to the tab load time.

On a decent internet connection, the steps our servers are responsible for (#3 and #4) take 200-300 milliseconds. Most of the time, slowly loading tabs are caused by #1 and #2 being slow (Facebook loads A TON of resources to get itself going).

This is especially bad on a slow internet connection, but even on a good internet connection if Facebook decides to be slow it will be.

Step #5 can be the worst. If a tab is loading a script or stylesheet from a reaaaaallly slow server, it will essentially *always* load slow.

For now, the best way to investigate the latency of a tab, and to pinpoint where it is coming from, is by using the network panel in chrome developer tools. Use visitor mode to view the tab without the admin editor, and it will load exactly as your users will see it.

When you’re looking in the chrome network panel, anything coming from the domain ____.statichtmlapp.com is our servers. The other stuff is either Facebook, or the assets from your tab, of course.¬†

– Jason



Leave a Reply