With one line of code, you can speed up WordPress to 3x as fast loading than before. By doing this, you give any reader the content you have written at a faster rate, giving them less of a chance to click the back button. This reduces your bounce rate (which I’m going to write about in a future post) and increases visitor interaction and conversion. Why wouldn’t you want this on your blog?
A quick note about the methods used: If you are currently using Gzip, this will not work in conjunction with one another.
UPDATE: [Oct 15th, 2009] – This technique is compatible with WP Super Cache.
zlib Compression for WordPress
zlib Compression in a nutshell takes WordPress code (the php to be exact) and compresses it before sending it to the visitor’s internet browser. The compressed file is then sent to the browser for it to be decompressed and displayed for the user. This process is much faster than just sending the uncompressed data to the browser which uses more bandwidth and is slower to load. The zlib compression will work with all the new major browsers and causes no compatibility problems to the older ones.
Making Sure that zlib Compression is Enabled:
To find out if zlib has been enabled on your web host, simply create a new file in Notepad (Or Notepad++ which is what I use) and paste the following code into the document:
<?php phpinfo(); ?>
Then simply uploading the file to your server and loading it in your browser will show whether you have zlib compression enabled or not. It can be found under a heading called, “zlib”.
Alternatively, if you know that zlib compression is enabled you can skip this step.
This code needs to be placed in the header of the document, at the very top of the code – even before the DOCTYPE. (Due to WordPress’s annoying feature that strips the beginning PHP comment out of the post, please type <?php before you paste the code below)
Then update the header file and you should instantly notice a difference… I know I did!
Check your zlib compression efficiency:
Simply go to http://www.port80software.com/support/p80tools.asp to check your compression factor, percentage and the number of bytes saved.
I referenced this post for the process and exact code on how to do this, I felt that this would be interesting for anyone with a blog. What inspired me to write this post was WPBlogHost’s post on Gzip compression, although I found out that my web hosting doesn’t support it!
Remember – Too fast is never a bad thing
Do you use any plugins or customized code to make WordPress load faster?