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.


November 22nd, 2007 at 5:43 am
I may have a better solution: don’t bother even visiting Facebook, since it’s alread becoming passé.
March 26th, 2008 at 2:04 am
Useless post.. does not explain how to fix the actual problem! Waste of 1 minute.
March 27th, 2008 at 1:06 am
Its a good post - explains the problem, suggesting a solution on Facebook’s part. Good job
April 7th, 2008 at 2:21 am
Useless post
April 10th, 2008 at 4:21 pm
Technically correct, but absolutely useless.
April 12th, 2008 at 1:26 pm
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)
April 20th, 2008 at 12:04 am
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!!!!!
April 25th, 2008 at 12:53 pm
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.
May 1st, 2008 at 2:55 am
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!
May 1st, 2008 at 8:15 pm
Yea Facebook is getting damn slow from this past week!!!.. they need to do something quick.. im running out of patience.
May 3rd, 2008 at 3:33 pm
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.
May 8th, 2008 at 6:31 am
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!
May 27th, 2008 at 7:48 pm
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
May 31st, 2008 at 12:38 am
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?)
May 31st, 2008 at 12:45 am
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.
June 1st, 2008 at 1:02 am
[…] And the explanation is here. […]
June 23rd, 2008 at 10:49 pm
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.
July 25th, 2008 at 3:37 am
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.
July 28th, 2008 at 9:38 pm
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.
August 18th, 2008 at 7:52 am
Useless post, thanks for nothing and the waste of time!