1 Incredibly Wicked Trick To Speeding Up Your Blog’s Load Time

Sun, Sep 6, 2009

Blog Optimization/SEO

We all know attention spans on the Web are small. Make a potential first time visitor to your site wait more than a few moments for your blog to load and they’ll click away faster than you can say, “But wait!”

Here’s an incredibly easy trick you can do to reducing that “but wait”-time for your blog to load. In most cases, it’s as easy as copy & paste.

Now who doesn’t like the copy, paste, and done tutorials?

Let’s first show you what to do and then for those who are interested, we’ll talk about what we did (in easy terms).

Copy This and Put It Here

Copy

<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], ‘gzip‘)) ob_start(“ob_gzhandler”); else ob_start(); ?>

Paste A (for WordPress users)

For WordPress users, paste the code up at the very top of your header.php file (above the DOCTYPE line). If you’re not sure how to do this, see the video at the end of this tutorial.

gzip-where-to-paste-php

Paste B (for static .html pages)

If your website is coded in html and not php, then what you’ll need to do is copy the code above and paste it up at the very top of each web page you want to compress (above the DOCTYPE).

The one change you’ll need to do here is change the extension of your web pages from .html to .php.

So for example, change: index.html to index.php

What Did We Do?

Without going into a bunch of techno talk, we basically instructed, through PHP, that the Web server compress files for transit to your visitors’ Web browser by use of gzip.

I’m sure you’ve seen zip files before (myfile.zip). Zip is a compression utility that takes a bunch of data and files and compresses them into one smaller size file.

By using gzip, we compressed your blog’s data into a smaller file size before sending it over to your visitor’s Web browser. As a result, your blog loads faster for your visitor.

Simple. Easy. Works.

How To Test It

Of course you’ll want proof that your site is loading quicker. You should notice a difference in load time just by clicking around your blog before and after the line is pasted in. But if you want to see actual data, head over to http://www.port80software.com and type your blog’s address in the Compression Check box.

Here’s the results for my blog. I circled the parts that showed my after compression data.

compression-snapshot

As you can see, my blog loads more than 4 times faster with the gzip compression enabled.

Also, the file size transmitted over the Internet and to my visitor’s browser was reduced from 60,241 bytes to just 12,963 bytes. That’s a 47,278 difference in file size!

WordPress How-To Video

For those who like videos, here’s how to copy and paste this command into your WordPress header.php file.

Share It

This little tip has helped many people decrease how long it takes their sites to load. If you have a moment, please consider sharing it through your social networks like Stumble Upon, Twitter, etc. While you’re at it, feel free to follow me on Twitter.

Related posts:
  1. Hammering Down 2 More Ways To Speed Up Your WordPress Blog
  2. How To Install Google Analytics On A WordPress Blog Without Using A Plugin
  3. WordPress Management: Cleaning Up Your Root Folder
  4. Creating A Blog Supermodel: Professionalism & Production Quality
  5. Intro To Creating A Supermodel Blog Design Series

, , , ,

53 Responses to “1 Incredibly Wicked Trick To Speeding Up Your Blog’s Load Time”

  1. Aaron Says:

    Hey John.. I’ve found a plugin called W3 Total Cache that has helped me MASSIVELY increase loading times by using compression, page caching, and database caching. I had never heard of it before I tried it.. always heard of WP Super Cache, but i find W3TC to work much better, it has memcached and CDN support, and just an overall great plugin. It might be worth mentioning in a future update to this blog post and compare the caching/compression plugins that exist out there.
    Aaron´s last blog ..Free BlogsMy ComLuv Profile

  2. John Hoff Says:

    Hi Aaron, yeah I’ve heard of that plugin as well and I tested once a while back but I think it conflicted with another plugin or something else that I was doing, so I stuck with the WP Super Cache.

    The W3TC plugin looks to work really well. Thanks for the input.


Trackbacks/Pingbacks

Leave a Reply

CommentLuv Enabled
PHVsPjxsaT48c3Ryb25nPndvb19hZHNfcm90YXRlPC9zdHJvbmc+IC0gdHJ1ZTwvbGk+PGxpPjxzdHJvbmc+d29vX2FkXzMwMF9hZHNlbnNlPC9zdHJvbmc+IC0gPC9saT48bGk+PHN0cm9uZz53b29fYWRfMzAwX2ltYWdlPC9zdHJvbmc+IC0gaHR0cDovL3dwYmxvZ2hvc3QuY29tL2Jsb2cvd3AtZmlsZXMtZ3JlZW5ibG9nL3dwLWNvbnRlbnQvdGhlbWVzL2ZyZXNobmV3cy9pbWFnZXMvZWluc3RlaW5zaG93LWFib3V0LXdwYmxvZ2hvc3QzMDB4MjUwLmpwZzwvbGk+PGxpPjxzdHJvbmc+d29vX2FkXzMwMF91cmw8L3N0cm9uZz4gLSBodHRwOi8vd3d3Lndvb3RoZW1lcy5jb208L2xpPjxsaT48c3Ryb25nPndvb19hZF9pbWFnZ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