Speed up WordPress to improve rankings
About this time last year, the SEO community was all of a chatter when Google announced page load time was going to become a ranking factor in 2010. Being a bit of a speed freak I always like to keep my blogs and websites as well optimised as possible. Unfortunately, time becomes short and things tend to slip so when I recently ran a couple of speed tests on my blog, my jaw hit the floor when I saw a page load time of 11.73 seconds!
I carried out 5 easy steps and managed to reduce the page load time to 3.66 seconds.
I used a couple of tools to test the page load time. The first was gtmetrix which uses Yahoo Yslow (also available as a FireBug plugin) and gives us a handy grade ranging from A to F. I also used Pingdom.com’s full page test which is similar to gtmetrix in that it breaks the page down in to its individual elements so we can easily identify bottlenecks.
Next up I installed the Gzip plugin. This enables gzip-compression and will speed up your WordPress blog drastically and reduces bandwidth usage as well.
Next I got in to a bit of sprite action using spriteme.org. This vastly reduces the amount of images being loaded on the page and therefore the number of http requests. Spriteme.org makes the process very simple. It scans your page for png’s, combines them in to one sprite and even kicks out the CSS for you to replace to get everything working.
Finally, I needed to add expires headers and remove entity tags (ETags). These 2 steps can only be carried out by editing or creating a .htaccess file. These little buggers are extremely powerful and can turn your website in to a pile of mush if you’re not careful so proceed with caution. .htaccess files need to be uploaded to the root of your site. Read more about .htaccess files here.
Adding expires headers means that a first-time visitor to your page will make several HTTP requests to download all of the files used to make up your site, but using the Expires header you make those files cacheable. This avoids unnecessary HTTP requests on subsequent page views. Expires headers should be used on all components including scripts, stylesheets, images and Flash components.
To add expires headers to your blog, add the following code to your .htaccess file.
AddType image/x-icon .ico
ExpiresByType image/jpeg A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/x-icon A2592000
ExpiresByType text/css M604800
A2592000 means 1 month in the future (60*60*24*30=2592000)
To remove ETags, add the following to the .htaccess file.
By removing the ETag header, you disable caches and browsers from being able to validate files, so they are forced to rely on your Cache-Control and Expires header.
So there we go, just using these quick steps improved my page load times by over 320%. Not bad for a couple of hours work.