WordPress is an amazing CMS that has opened the world of publishing to everyone, but it can also be horribly slow. Here are a few plugins and server-level changes you can make to give your site an instant speed boost.
Strap in, and please keep your hands and feet inside the ride at all times.
Check Your Load Time
Use WebPageTest.org to do a quick performance review – specifically you’ll want to check the scorecard to see areas in need of improvement. If you’re doing particularly badly in one area, you can investigate further. (In this instance, I haven’t minified files, so no attempt at compressing them is made either) In any case, re-run the test after making changes outlined below so you can continually check improvements. If your score is in the 90s, you’ve done great!
WordPress Plugins For A Faster Site
p3 Plugin Profiler
First, use the P3 Plugin Profiler to identify the key slowdowns on your site. If you find a significant offender, consider how badly you really need that plugin. Could you manually code some of the functions instead? Consider how much of the page load time – perhaps a second or more – is being used by those plugins, and think very seriously about exactly what value they add to your site. Yes, we do maintain a list of Best WordPress Plugins, but honestly if you installed them all your site would take a few minutes to load.
For instance, instead of using a plugin to inject Google Analytics code, just open up the header.php of your theme file and paste the code in manually instead – boom! There’s another MySQL query you’ve saved by not having to load that plugins options. To get started, select Start Scan then Auto-scan from the new Tools -> P3 Plugin Profiler option. In this example, I’m pretty happy with the current impact of plugins – overall, they’re only contributing 0.3 seconds per visit, the majority of which comes from an essential SEO plugin. I can live with that, so I won’t be disabling any plugins – the problem lies elsewhere.
W3 Total Cache
This is the swiss army knife of caching plugins, but sometimes feels like the ultimate deluxe model with 100 attachments, so complex and fiddly that making use of even one of those attachments is enough to put you off and just forget the whole thing. If you’re into self flagellation, check out my quick introduction to setting up the plugin, but note that you will need to do some deeper level server installs to get the best from the plugin.
WP Super Cache
Use a CDN to Serve Static Files
CDNs are a premium service that host your static JS, CSS, and image files at super fast speeds, leaving your server to concentrate on serving the HTML. You’ll need to the W3 Total Cache module to handle rewriting file URLs. The user’s browser will make an attempt to load the files from the CDN, and if the CDN doesn’t already have that particular file, it’ll pull it first from your server – this is called a PULL zone, funnily enough. MaxCDN is a budget service that I use.
PHP usually runs as an Apache module; enabling FastCGI make it run as a separate process. This is typically just a setting in your severs control panel – no need to install anything additional or configure settings. One click to make things faster. Many hosts, like Media Temple, are now automatically enabling this on all new hosting accounts. Still, it’s worth checking anyway, since it’s such a simple and effective step.
Mod_pagespeed was created by Google to make site optimizations easy for everyone. It’s not quite “easy for everyone” yet, but if you are able to get it configured you’ll experience a significant speed boost. The Apache module performs a number of different code tweaks automatically when the page is served, such as JS and CSS minification and compression, and JPG optimizing. Some of these could admittedly be achieved using w3 Total Cache, but mod_pagespeed really does make the whole process less painful – I’ve never been able to configure the minification correctly through w3 Total Cache without breaking some plugins or messing up the stylesheet. On Media Temple Grid Service accounts, enabling mod_pagespeed is a simple case of clicking “enable” for every domain you want it on. Yes, it really is that easy, which is why I’m tempted to move quite a few of my sites over to the Grid Service. DreamHost apparently also supports this for all levels of customers. On unsupported hosts you should check the Google install instructions, but you’ll need root access to the server so this certainly isn’t applicable to unsupported shared hosting services.
If you’re caching anything in W3 Total Cache, you’ll only have Disk and Disk: Enhanced available by default. Alternative PHP Cache (or APC for short) is an additional piece of software you can install on your server to give you RAM-based caching. Some people find that selecting APC for minify and page cache is actually detrimental – use Disk Enhanced instead, leaving APC for object and database caching. Your experience may vary though, so again, try each setting, and re-test. Installing APC will require root access (though some have managed towith debatable benefits), so you’ll need to find instructions on your specific OS or host.
Read up on what exactly CloudFlare is here, but here’s the TL;DL version: an instant speed boost by simply changing DNS.
WPEngine is specifically built and optimized for WordPress, with many of these recommendations already enabled by default – but this comes at a price of $29/month for a small site of up to 25,000 visits. Media Temple Grid Service are the best general purpose shared host with one click installs for most of these optimizations, starting at $20/month – we’ll have a full review and giveaway next month, so stay tuned for that!
You can speed up WordPress, but as you can see it takes a bit of work to squeeze every bit of performance. Any more tips you can add to the list? We’d love to hear them below.
Image Credits: Shahbaz Majeed Via Flickr