Question

Here's a speed test report:

http://tools.pingdom.com/fpt/#!/q25sGwB65/www.scirra.com

As you can see about half that speed is lost to social buttons. I'm doing some reports on page loading time, and we wish to exclude these from the report but they must be reproducable in Pingdom.

I've tried loading the scripts like this:

$(document).ready(function () {
    setTimeout(function () {
        $.getScript("http://platform.twitter.com/widgets.js");
        $.getScript("http://apis.google.com/js/plusone.js");
    }, 100);
});

But it still counts them. Any one know how to do this?

This is also possibly more important than just report aesthetics, Google page speed in webmaster tools also counts these during loading as far as I can tell, and page speed is used as a factor in rankings so it would be good to be able to hide these loads from Pingdom and Google if possible.

Edit

T.J's suggestion of using window load doesn't make any noticable difference on the reporting either:

$(window).load(function() {
    $.getScript("http://platform.twitter.com/widgets.js");
    $.getScript("http://apis.google.com/js/plusone.js");
});
Was it helpful?

Solution

Stoyan has some good ideas on how social buttons should implemented asynchronously, this may help you - http://www.phpied.com/social-button-bffs/

Eliminating in from the waterfall is going to be pretty hard as Pingdom will use a browser or proxy of some sort to capture the load information.

Why do you want to eliminate them for the report?

You could use webpagetest.org and just block the URLs

OTHER TIPS

We do something like this:

$(function(){
    setTimeout(function(){
        /* load twitter, facebook */
    }, 3000);
});

This tries to make sure that all the essential work to be done on the page is completed before the less important Twitter, FB buttons are loaded.

Not really sure pingdom will not report this though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top