Do Better on Google: Speed Up Your Site Load Time

by Martin Malden

SpeedWith Google now including page-load times in the factors it uses to rank sites for the natural search results, a recent article on the SEOmoz blog giving 7 ways to speed things up caught my attention.

Some of them I was already using but one that I wasn’t was Gzip compression, so I dived right in.

Compressing your site files before they’re sent from your server to the browser that’s viewing them reduces the amount of data that has to be transferred. And that speeds up page-load times – a lot.

It’s like using Winzip to compress Word or PowerPoint files before you email them.

As long as your server is running Apache you can follow these steps to activate compression and speed up your site load times:

Step 1:

In your WordPress root folder (the folder where your WordPress files sit) find and open the .htaccess file.

You may need to do this with your FTP client because some hosting provider file managers hide this file.

Here’s what it looks like using FileZilla:

HTACCESS file in FileZilla

Right click on the .htaccess file and the third option down is ‘view/edit’.

Step 2:

Select ‘view/edit’ and FileZilla will download and open the file with Notepad.

Step 3:

When the file is opened paste this entire block of code into it:

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

Or, to compress certain file types by extension edit and use this (add the extension file types you want to compress):

<Files *.html>
SetOutputFilter DEFLATE
</Files>

Step 4:

Once you’ve pasted that code into the file save and close it.

When you’ve closed it, FileZilla will ask if you want to upload the changed file back to the server:

Filezilla confirmation request

Step 5:

Click ‘Yes’ to upload it back to the server.

Step 6:

Once the file has been returned to the server you can click View>Refresh to see that the new file has been successfully uploaded.

Make a note of the file size before refreshing. After refreshing it will be around 500 bytes larger.

Step 7:

Disconnect from the server and close FileZilla. You’ll see a message that claims an edited file is still open and warning that if you close FileZilla your changes will not be saved.

As long as you verified that your updated .htaccess file has been updated (step 6) you can ignore this warning.

That’s it – you’re all done and your site visitors (and Google) will have a big smile on their faces.

Update – 3rd August, 2012:

The SEOMoz blog just released an updated article on ways to speed up page load times – this time there are 15 tips, although some of them are repeated from the article I linked to earlier.

You can find it here.

Cheers,

Martin Malden

Please share this article - I'm counting on you!
       
Found this article useful? Get free updates!

Get regular updates, plus a free eBook on how to set up a business online - join us!

Your details are safe with me.
My Privacy Policy.

Previous post:

Next post: