Click to call

We have all faced the dreaded slow-loading wordpress installation.  After dealing with this time and time again we have come up with a few tricks to get you through this pretty quickly.

First
Make sure you are running on a decent server. If you’re on a shared server, you’re at the mercy of the others sharing the account with you.

Second
Cut down on the plugins and trim out any non-essentials.  No really, strip it all the way down.

Third
Install a caching plugin. Super Cache by Automattic (the same company that built WordPress) is a great one if you need a quick & dirty solution, though W3 Total Cache is another option that requires more setup/configuration.

Fourth
Be sure your images are as optimized as they possibly can be.  Re-size them in photoshop, then use Photoshop’s “Save for Web” tool to save them into a smaller file size.  Finally, you can use the SmushIt API to really compress them to as small as possible.

Fifth
Time for some .htaccess magic. We need to be sure gzip compression is enabled and that we set Expiry headers. Here’s the code you want, just paste this into your .htaccess file:


# Enable gzip compression
AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
AddOutputFilterByType DEFLATE font/truetype font/opentype
# Expire images header

ExpiresActive On
############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires
<FilesMatch “.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$”>
ExpiresDefault “access plus 1 year”

# Remove Etags
FileETag none

Sixth
Be sure you are using a CDN.  Some hosting providers will supply them with your hosting, or you can use a service such as Certahosting.

Now give your newly tuned up site a whirl over at Google Site Speed Checker and see how you did!