TwitThis Causes Pages To Load Slowly – Here is a fix

 

Have you noticed my pages loading extremely slowly over the last few days? I am not talking about my sidebars, which appear after my content, but my articles which always load first, and usually quite fast.

The culprit is TwitThis, that seems to be using Amazon S3 to store images.

Here is the standard TwitThis code:-

<!-- Begin TwitThis (http://twitthis.com/) -->
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://andybeard.eu/wp-content/uploads/twitthis_grey_72x221.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
<!-- /End -->

What you need to do is host the TwitThis logo on your own server to speed things up.
Here is the image used that you can save to your harddisk and then upload to WordPress or other blogging platform.

twitthis_grey_72×22.gif

Then all you need to do is insert it into the code

In my case this is what I am using

<!-- Begin TwitThis (http://twitthis.com/) -->
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://ndybeard.eu/wp-content/uploads/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
<!-- /End -->

Actually I have listed a broken URL above, I don’t want people just copying the code and trying to use the image from my server.

As an alternative to the TwitThis button, Jemmille has created a modified version of my hacked Sociable plugin Antisocial that includes a “TwitThis” button, and a fix to StumbleUpon.
I will probably update my distribution with Jemmille’s code in a few days, but you can get it directly for now.

Update: This wasn’t a total fix because the Javascript was still being loaded from Amazon S3 and was causing horrendous page load times. TwitThis has been removed until I can hack a version that doesn’t use javascript.

 

Liked this post? Follow this blog to get more. Follow

Comments

  1. says

    I stripped the little twitter widget from my sidebar. It’s too slow. I also dumped sphere which I was trying out.

    When your hit count on your server are much larger than the number logged by sitemeter in the footer and you can sip a glass of wine as your page l_o_a_d_s, you know there is a problem.