Make My Blog Faster

In day one, my blog was very fast. These days, I don’t feel it is as fast as it was long time ago. I started to add more and more elements to this blog, and unfortunately, it slows everything down a bit at a time, and now, it is not as fast as before.

At the same time, I am working very hard in my company to make Baixing.com even faster. These two things can be done in parallel, and I can use some tips and learning from this site and apply it to my blog.

I am a fan of Steve Souders, and reading his book High Performance Web Site, and his blog. I will apply those technical to this blog, and then report the result to my readers.

Here is a rough plan:

  • Setup metrics – using Google Analytics to track time used on each page.
  • Remove stuff – the less stuff on this page, the better
  • Optimize CSS, and JS to ensure I am a minimalist
  • Check data to see if it faster or not

I will keep updating this page (not new pages) about the progress, so you can check from time to time to know the progress.

Update May 5, 2009

Today, I added the tracking code to the individual archive page, so I can keep measuring what is happening to my network speed. Here is the code I used:

  1. Immediately after <body> tag, add the following

    <script>var t_start = Number(new Date());</script>

  2. At the end of the file, add the following:

    <script type=”text/javascript”>

    window.onload = function() {

    var t_end = Number(new Date());

    var t_duration = t_end – t_start;

    var lc1 = Math.floor(t_duration/1000);

    var lc2 = Math.floor((t_duration % 1000)/100);

    var lc3 = Math.floor((t_duration % 100)/10);

    var lc4 = t_duration % 10;

    try {

    var pageTracker2 = _gat._getTracker(“UA-XXXXX-3”);

    pageTracker2._trackPageview(“/speed/” + “/” + lc1 + “/” + lc2 + “/” + lc3 + “/” + lc4);

    } catch(err) {}

    }

    </script>

    UA-XXXX-3 is my profile ID in Google Analytics. If you read the code more carefully, you see it generally calculate the time from the start of parsing the page (t_start) to the end of the page load (t_end or window.onload event), and then turn it into a folder structure and record it in Google Analytics. For example, 3402ms will be recorded as /speed/3/4/0/2, and thus I can do more analysis in the future.

It is always a good idea to setup measurement before doing anything (that is important), since it helps to guide you through a more certain road, than just wandering around, and run back and forth.

3 Comments

  1. Take out google adsence. I don’t think there are people clicking on them. They are everywhere, every blog. And earning money from there is very slow. Might take years if you don’t have much readers.

  2. Don’t bother. I use google reader.

    Btw, adblock plus will block all google (and other) ads so I don’t care what ads you put on the page.

  3. On the Google AdSense part, it IS slow, and I am trying something to make it faster.

Leave a Reply

Your email address will not be published. Required fields are marked *