With 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:
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:
Right click on the .htaccess file and the third option down is ‘view/edit’.
Select ‘view/edit’ and FileZilla will download and open the file with Notepad.
When the file is opened paste this entire block of code into it:
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>
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:
Click ‘Yes’ to upload it back to the server.
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.
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.