Facebook is slow, but there’s an easy fix

It seems like the Facebook engineers add another javascript and css file to their pages with every new feature. As of today, viewing the Facebook homepage loads 36 javascript files from Facebook and 4 more from advertisers. In addition to these 40 files, there are 12 css files.

That’s a lot of files! If you’ve ever noticed the excessive flickering happening in your browser’s status bar when you go to Facebook, this is the cause.

How can they improve the situation? The total file size isn’t too terrible at about 100k of JS and 40k of CSS. The best thing to do would be to use a simple build script that concatenates all these files together into one larger file. If they can’t do that for some reason, they could at least serve the files from more than one domain to take advantage of parallel downloads in the browser. They could also try a service like Akamai, but that’s a bit more complex and expensive.

This seems like a really silly oversight from an organization that in general produces beautiful work. My guess is that when the company was getting started they set up a relatively simple build process that has now become ingrained and difficult to alter as their setup has quickly become larger and more distributed. However, they’ve reached the point where it’s time to revisit things and do it properly.

20 Responses to “Facebook is slow, but there’s an easy fix”

  1. Peter Bromberg Says:

    I may have a better solution: don’t bother even visiting Facebook, since it’s alread becoming passé.

  2. Ryan Says:

    Useless post.. does not explain how to fix the actual problem! Waste of 1 minute.

  3. Gigi Says:

    Its a good post - explains the problem, suggesting a solution on Facebook’s part. Good job

  4. Claudio Says:

    Useless post

  5. Your Father Says:

    Technically correct, but absolutely useless.

  6. moke102 Says:

    could maybe one of you cleverheads, or a really clever one tellus not so clever ones a second solution instead?
    thanx in advance ( and good hope)

  7. Fabian Says:

    Does not help me at all… send it to facebook… im still wondering whether to go have a shower or have my lunch or rather do both while facebook continues to load!!!!!

  8. Martin Says:

    I am writing this as I wait for Facebook to load… I thought it would have been down to the amount of traffic, although as it’s 9am I would imagine it isn’t ‘peak’ time so I agree it must the scripting.

    Message to Facebook - get your finger out, for one of the worlds biggest social networking sites, this is pathetic.

    Oh, great ‘Problem loading page’. What a surprise.

  9. Tracy Says:

    Cannot believe this, once I get into the swing of things this silly site decides to work EXTREMELY slow! What’s going on facebook?? sort it out pls!

  10. Xterminator Says:

    Yea Facebook is getting damn slow from this past week!!!.. they need to do something quick.. im running out of patience.

  11. Pro Ro Says:

    Are most people using IE to view Facebook? I’ve found that Firefox now seems to deal with Facebook a lot quicker than IE does, so have started using that instead.

    I’m not an MS basher - I usually find IE more functional than Firefox in general (bet this will generate some flames!) so I still use it for other browsing, but it may be worth a try if you visit Facebook frequently.

  12. matty p Says:

    did that !@# at the top actually say ‘passe’
    whats passe, getting in touch with old friends
    doing business…? or just being a facegeek…
    i agree its a bit overhyped, and its not perfect, but it serves a very good purpose
    …sorry, its just…
    besides, who says ‘passe’
    damn!

  13. jfn Says:

    This past week I keep getting timeout errors when trying to log in to facebook. The login page comes up quickly enough, and I was also able to browse their help pages fast as well - but when I key in my email and password, then hit the login button, the page goes white, sits for a while and then I get the timeout error. A right royal pain in the rocks! Every other webpage I visit is working as normal. Any ideas what this could be?

    Cheers,
    J

  14. Nico Says:

    Same from Switzerland (MUCH slower since abt 3 weeks, timeouts, etc.)…

    But indeed, apart from the good feeling of not being the only one with the problme, quite a useless post (what is the fix?)

  15. Udi Says:

    If you want a fix, I’d suggest forwarding a link to this post to Facebook. They’re the only ones that can fix this issue.

  16. Facebook: fix your load times « Jared Tame @ Phunctional Says:

    […] And the explanation is here. […]

  17. Kenny Brunton Says:

    I’m not a fan of facebook (faeces book as I call it). Kind of ditched them when I discovered Microsoft had dibs in their advertising.

    Here’s a tip which may help though, install a hosts file on your PC that blocks their advertising - okay, it wont fix all the issues.

    Just these may work (not sure)

    127.0.0.1 ads.facebook.com
    127.0.0.1 ads.ak.facebook.com

    Alternatively - visit here http://www.mvps.org/winhelp2002/hosts.htm where there’s plenty of information and a good hosts file you can use.

  18. superj from g-town Says:

    HERES YOUR BEST AND QUICKEST SOLUTION
    download latest version of safari from http://www.apple.com/safari/download/
    seems to handle facebook easily and is a pretty quick fix,but you will need to download the FLASH plug-in from here and install it,very very easy!
    works so much better for me,im using windows xp sp3 with all updates.

  19. Evgeny Says:

    Good post, and I completely agree.
    They should somehow concatenate this stuff, and make it more “browser cache” friendly. Since even with this multitude of javascripts/stylesheets they have — it is still being served in a way that each request gets a new file. And the browser cache (especially firefox) does not store it for faster loads in the future.

  20. Ryan Says:

    Useless post, thanks for nothing and the waste of time!

Leave a Reply