If you ended on this article, you are probably aware that social widgets such as Facebook and Twitter will hurt your website’s performance. Depending on the scope of your project, it can be solved with some jQuery magic.
I recently worked on a quick redesign of the BetterOptin website, which lead to some pagespeed optimizations. There a Facebook Like Box at the bottom of the page, which was slightly slowing down the site. Here’s how I “fixed” it.
Facebook widget in the footer?
If your Facebook widget is located at the very bottom of the page, why on earth would you load the script when the page loads? When the user lands on your site or article, he might scroll all the way down. But you can be pretty sure that he’s not going to interact with your social widgets. The user needs to go trough your content first, and then eventually decide to follow your Facebook page.
In my opinion, we should serve stuff to the user when they need it.
Delaying the load of the Facebook SDK
Thanks to jQuery, loading a script after xx seconds is pretty straight forward. Here you go:
Please leave some feedback in the comments.