Welcome to WebmasterWorld Guest from 54.145.55.135

Forum Moderators: Robert Charlton & aakk9999 & andy langton & goodroi

Message Too Old, No Replies

Google 1 button is slowing down my page load

     
11:19 pm on Jul 8, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 2, 2009
posts: 194
votes: 0


It was a real pain to add the +1 button and make it fit in layout and get along the other buttons alignment. But what I noticed once I finshed spread it all over my site is a horrible slow down in page load.

All page loads fast, but the +1 button is the last one in loading and while it does leaves the page like frozen until it does completely. For instance the main navigation menu (pure css) won't show subitems until the +1 button finally appears.

Code I have just before <body>

<!-- google+1 --><script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>


Then

<g:plusone size="medium" count="false"></g:plusone>


That's pretty bad news to me. Anybody experiencing same thing? Any way to fix that up?
8:26 am on July 9, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:May 17, 2011
posts: 193
votes: 0


It added around 0.8s to my page load (taking some image-heavy pages well above 3s which I'm not comfortable with). I tested it for a week and as soon as I removed it I can see from my own testing and Google's testing that page load speed increased again.

What a load of crap. Just not worth it.
10:27 am on July 9, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:May 7, 2003
posts:750
votes: 0


I've seen sites do a screenshot of the row of buttons and replace all the buttons with a single screenshot. Then on mouseover, the screenshot is swapped out for the real thing.
10:38 am on July 9, 2011 (gmt 0)

Preferred Member

10+ Year Member Top Contributors Of The Month

joined:Jan 20, 2005
posts:489
votes: 0


I've recently gotten rid of +1 and Facebook. The loading times on the site that I was testing it on skyrocketed according to WMT to the highest loading times ever. Not impressed.
11:48 am on July 9, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 12, 2004
posts:610
votes: 3


You can use Jquery/getScript (or other alternatives) to load scripts after document.ready. +1 and twitter works out of the box, for Facebook, just use window.fbAsyncInit function..

/* Enable Cache */
$.ajaxSetup({ cache: true });

/* Facebook */
window.fbAsyncInit=function(){FB.init({appId:'999999999999',status:false,cookie:false,logging:false,xfbml:true, channelUrl:'http://www.example.com/channel.html'});};


$(document).ready(function(){
setTimeout(function(){

$.getScript("http://connect.facebook.net/en_US/all.js");
$.getScript("http://platform.twitter.com/widgets.js");
$.getScript("http://platform.linkedin.com/in.js");
$.getScript("http://apis.google.com/js/plusone.js");

},100);
});
3:33 pm on July 9, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 13, 2005
posts: 716
votes: 0


Interesting. I added +1 buttons to each article in the news section of a website a couple of days after this was announced just to experiment.

The news is a service I pay for in a niche industry - very specific but high quality - and comes in batches of 5 - 10 articles every day. I'd guess around 10 sites in my niche use it. I've had the service for 9 months and it gets about 100-150 referrals from Google each day. I am invariably the first to publish each story.

Within a week of after adding +1 buttons, all Google referrals to the news pages has slowed to a trickle (5-10 a day) *. The articles are still indexed but several pages down when they used to always appear in the Top 3 SERPS. It's the only significant change to the site in 3 months (and the only one to the news section in 6 months) although referrals to the other sections of the site are still strong.

Not sure if it's related but the page load thing made me think it was worth sharing. Until now I was thining it was down to a problem with occasional mysql timeouts I have been investigating although I thought that was odd as they are rare (I see them once or twice a week).

It's not the quickest site ("quicker than 54% of sites"), so can/does Google penalise only certain sections of sites based on response times?

* when I say slowed to a trickle, it actually happened suddenly overnight indicating a davluation of the whole section at one moment.
7:19 pm on July 9, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:May 21, 2004
posts:449
votes: 0


According to wmt there is a very noticeable site slow down after adding the button, I would sacrifice that - but there has not been one single click yet.

I'm most likely removing the plus one for now, I'll add it back later if it "catches on."
7:28 pm on July 9, 2011 (gmt 0)

Preferred Member

5+ Year Member

joined:Mar 20, 2011
posts:544
votes: 0


Yeah I can confirm that I have seen a definite jump in page load time not just in my own tests, but a very obvious and visible jump in Webmaster Tools as well.

Not good, but... Google is too big not to try the +1.
8:40 pm on July 9, 2011 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member dstiles is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:May 14, 2008
posts:3125
votes: 4


When google analytics first came out I noticed a huge delay on page-load on any site I visited that containined it. As a result, I never added GA on any of my sites and blocked it through my browser controls for any site I loaded. Result: faster page load on GA sites.

Of course ANY extra code drawn from a third party site will slow down page load, whether it is adverts or javascript or whatever.

In the USA the slow-down for google-based code may not appear too high, but the rest of the world will certainly notice it.

Own-site-based file requests have already determined the domain look-up and source IP so code access will be quick. Looking up a third-party site takes more lookups - several if any of them fail due to a DNS problem.

Internet speed may be high. It is not instantaneous.
2:24 pm on July 13, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 2, 2009
posts: 194
votes: 0


This far seems more cons than pros. I really hate the delay caused by the button and don't like the idea of this seems like a beta testing to fight facebook, and probably is costing me.
2:30 pm on July 13, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member sgt_kickaxe is a WebmasterWorld Top Contributor of All Time 5+ Year Member

joined:Apr 14, 2010
posts:3169
votes: 0


I was complaining about this (inline .css, multiple javascript files, rendering of image without sufficient expires etc) from the first time I tried it. Hopefully Google listens.

Twitter and Facebook allow you to create a simple url to link your own hosted images to, no javascript required. Google REALLY should do the same although I'm sure they want the traffic data from the javascript loads more.
9:11 am on July 26, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 13, 2005
posts: 716
votes: 0


Just dragging this thread back up with an observation. I said previously:

Within a week of after adding +1 buttons, all Google referrals to the news pages has slowed to a trickle (5-10 a day)


Just thought I'd add that about 10 days after posting that I removed the +1 buttons from the news articles and within 48hrs the traffic to the news section was back to normal levels (up to about 150/200 uniques a day). Two note: 1) addig +1 was the only change I had made to the news section in months and 2) during all that time, traffic to other parts of the site always remained consistent.

Nothing conclusive, may just be pure coincidence. Or it may be that the load times of +1 just tipped the balance as the server isn't the fastest.
4:58 am on July 27, 2011 (gmt 0)

Full Member

5+ Year Member

joined:Oct 9, 2007
posts: 295
votes: 0


You can use Jquery/getScript (or other alternatives) to load scripts after document.ready. +1 and twitter works out of the box, for Facebook, just use window.fbAsyncInit function..

Is this a further advantage over using the asynchronous code?

My Facebook code for example currently looks like this -


<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
status : true,
cookie : true,
xfbml : true,
channelUrl : 'custom channel url'
});
...
};

(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>


It loads asynchronously, i.e. doesn't freeze the rest of the page, but still frequently causes the page load time to go through the roof. It also occasionally seems to screw up and leave the page "loading" with a blank screen (but if you view the source you can see that the entire HTML has been received) - this seems to be related to that properly evil xd_fragment bug that required a custom channel URL to 'fix'.

I hadn't thought of taking it to an Ajax level. That sounds interesting. But JQuery is 90 KB and my site doesn't use it at present, so it would have to reliably solve all those issues to be worthwhile. Is there a way of extracting just the single method (getScript) you want to use?
5:09 am on July 27, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 3, 2002
posts:2575
votes: 0


Have you guys seen this? Apparently G is rolling out an update to make +1 load 3x faster?

[googlewebmastercentral.blogspot.com...]
5:22 am on July 27, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:May 29, 2003
posts:699
votes: 9


From the above link -
For those of you who have already implemented the button, you’ll need to update the code to the new async snippet, and then you should see an overall improvement in your page load time.


Oh, great. Now you tell me. I use no CMS.
I'm done.
The code goes.
Have we no pride?
The onus is always upon us. How long before the NEXT REQUIRED code update?
Too many bullets being fired at my feet to make me keep dancing. I don't like it.
.
5:43 am on July 27, 2011 (gmt 0)

Full Member

5+ Year Member

joined:Oct 9, 2007
posts: 295
votes: 0


Seriously? You've not heard of includes? C'mon.
5:45 am on July 27, 2011 (gmt 0)

Moderator This Forum from US 

WebmasterWorld Administrator robert_charlton is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 11, 2000
posts:11584
votes: 240


You can relax while the button renders, Sally. You only have to dance to enable the asynchronous loading. ;)

First, we’ve begun to roll out out a set of changes that will make the button render up to 3x faster on your site. No action is required on your part, so just sit back, relax, and watch as the button loads more quickly than before.

In addition to the improvements made to the button, we’re also introducing a new asynchronous snippet, allowing you to make the +1 experience even faster.... For those of you who have already implemented the button, you’ll need to update the code to the new async snippet, and then you should see an overall improvement in your page load time....
5:57 am on July 27, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:May 29, 2003
posts:699
votes: 9


I don't know what "includes" are. I am not a programmer.
I have skated by with minimal knowledge - mostly just old simplistic HTML.
My background was all 1960s and 1970s hardware, before includes were invented. Sorry.

I was pretty good at SSI, then MSI, LSI, VLSI - way back when.
6:08 am on July 27, 2011 (gmt 0)

Full Member

5+ Year Member

joined:Oct 9, 2007
posts:295
votes: 0


Well what are you complaining about. It's hardly Google's responsibility to script your site for you.
6:12 am on July 27, 2011 (gmt 0)

Moderator This Forum from US 

WebmasterWorld Administrator robert_charlton is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 11, 2000
posts:11584
votes: 240


Since you've already put the obsolete code in the old fashioned way, Sally, just replace the old code with the new code by doing a global search and replace. You can generally do this with a good text editor.

Get some guidance in an appropriate forum here when you're ready to do it. It's not rocket science, but it pays to be careful.
6:24 am on July 27, 2011 (gmt 0)

New User

5+ Year Member

joined:Sept 14, 2009
posts:17
votes: 0


I have interpolated the code for twitter...

<script type="text/javascript">
(function() {
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
po.src = 'http://platform.twitter.com/widgets.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>


The code for Facebook will be an extension of that.
11:46 am on July 27, 2011 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 25, 2005
posts:89
votes: 2


I removed it too for speed issues.

System

1:04 pm on July 27, 2011 (gmt 0)

redhat

 
 


The following 6 messages were cut out to new thread by engine. New thread at:

Google Takes Notice And Makes +1 Button Faster
google/4344577.htm [webmasterworld.com]


6:19 pm on Jul 27, 2011 (utc +1)

[edited by: Robert_Charlton at 6:06 pm (utc) on Aug 10, 2011]
[edit reason] added topic of new thread [/edit]

5:38 pm on July 27, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 5, 2002
posts: 1853
votes: 3


I had the same problem with the Google Analytics javascript and the Facebook Like button javascript. They really slowed down page load time so I haven't even tried Google+.
7:29 am on July 28, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 12, 2004
posts:610
votes: 3


jquery is ~35kb compressed. I combine the jquery code and my custom loaders etc. in one .js file and load it asynchronously. It definitely makes difference, pages load first, and buttons etc. loaded in background later.

BTW, I also append button codes just before loading external scripts, so the page is valid (for non-js bots anyway)



var likecode='<fb:like href="http://www.facebook.com/" send="false" layout="button_count" width="90" show_faces="false" font="arial"></fb:like>';
var tweetcode='<a href="http://twitter.com/" class="twitter-follow-button" data-button="grey" data-text-color="#FFFFFF" data-link-color="#FFFFFF" data-width="225px">Follow @</a>';
var pluscode='<g:plusone size="medium"></g:plusone>';

$('#likediv').append(likecode);
$('#tweetdiv').append(tweetcode);
$('#plusdiv').append(pluscode);
6:35 am on July 29, 2011 (gmt 0)

Full Member

5+ Year Member

joined:Oct 9, 2007
posts:295
votes: 0


Looks good.

I'm slightly dense when it comes to JS. How do you load JQuery itself asynchronously; with something like jQl ?
3:44 pm on July 29, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 12, 2004
posts:610
votes: 3


<script type="text/javascript">
(function(){
jqhead=document.getElementsByTagName('head')[0];
var jqscript=document.createElement('script');
jqscript.type='text/javascript';
jqscript.async=true;
jqscript.src='yourscript.js';
jqhead.appendChild(jqscript);
})();
</script>


The trick is, you should put all jquery commands in that external script, after the jquery code. With async loading, if you put them after that code, or in other external js file, the browser might call them before jquery is loaded.
5:36 pm on Aug 3, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 5, 2002
posts: 1853
votes: 3


Wow, I couldn't reach webmasterworld.com just now for at least 5 minutes. Firefox said "Connecting to ssl.gstatic.com".
8:49 pm on Aug 5, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 2, 2009
posts: 194
votes: 0


I had to remove +1, it was a real pain.
Any serious notices about a better performance of +1? Heard google is making it faster, but I really don't want to put it again since my last experience was disaster.
10:24 pm on Oct 14, 2011 (gmt 0)

Full Member

10+ Year Member

joined:Oct 19, 2002
posts:308
votes: 0


According to wmt there is a very noticeable site slow down after adding the button, I would sacrifice that - but there has not been one single click yet.

I'm most likely removing the plus one for now, I'll add it back later if it "catches on."


I agree with you totally. I'm removing the button from my site as soon as I leave here. The button also bothers me because users don't know what it is, and for those that do click on it they then find out they need a gmail account. Sure it's ticked off lots of my viewers.
This 31 message thread spans 2 pages: 31