Vroom, Vroom: A Comprehensive Guide To Speeding Up A WordPress Blog

car speedometer fast   Vroom, Vroom: A Comprehensive Guide To Speeding Up A WordPress BlogMakeUseOf serves hundreds of thousands of visitors everyday, and we do it all on WordPress. WordPress can and does scale from tens to millions of pageviews, but you’re going to need some heavyweight plugins and strategies to increase performance at that level. Here’s a comprehensive list of things you can do to speed up your blog, and the plugins you can use to do it.

Switch hosting provider

I’ve explained before about the differences between types of hosting, but it boils down to this: shared hosting is very slow. If you’re still running on shared hosting, that is your greatest bottleneck. An incredibly fast virtual private server costs as little as $40/month, and not only gives you an instant speed boost, but allows you to implement server level customization’s to speed up WordPress even more.

Host external resources on a CDN

We’ve talked about CDNs before too; they’re just high speed filestores that mirror files in local caches around the world, so while the core site is run on your server, images and Javascript resources are pulled from the CDN, resulting in near instant download times. Without a CDN, you’ll find images load sequentially and slowly – you can actually see images as they load in line by line on some shared hosts. Even ignoring the speed benefits, CDNs are far cheaper to host files on than web hosts.

2 aws generalcdn   Vroom, Vroom: A Comprehensive Guide To Speeding Up A WordPress Blog

I’d suggest MaxCDN, which I personally use and is very cost effective – but to connect to WordPress side of things you’ll need a plugin to change your image and resource URLs to the URL of your CDN provider. w3 Total Cache handles this admirably if you’re looking at an all-in-one solution, but for CDN functionality alone, try these:

  • jsDelivr is a free Javascript CDN which will load all the various scripts WordPress uses from their CDN; you can pick and choose which to load. They won’t host your images though.
  • WPSuperCache will be mentioned elsewhere; it includes CDN support with the addition of CDN Sync Tool.
  • WPBooster has a dedicated plugin, though the service pricing is far greater than a general CDN.

If you have large files (like music or PDFs) where speed isn’t essential, Amazon s3 is an even cheaper option to offload them from your server. It can also be used as a CDN, but isn’t as fast (Amazon also does a CDN called CloudFront you may wish to look at).

Minimize text files

HTML and Javascript are generally made to be human-readable; that is, they include comments, unnecessary tabs, line breaks and useful names – all of which make a file larger. Minimization strips out all that unnecessary stuff and compresses the file so it’s still perfectly functional, yet significantly smaller. The only downside is that development on a live server can be a little more difficult as the code is obscured, like this:

minimized   Vroom, Vroom: A Comprehensive Guide To Speeding Up A WordPress Blog

A secondary process that’s often used with minimization is to combine separate Javascript and CSS files. Each script on your site results in an additional request to the server; combining them all means the whole thing can be grabbed in one with no loss in functionality.

Both can again be done with w3 Total Cache, or you can use the standalone JS&CSS Script Optimizer plugin. The only difficultly with minimization is ensuring the load order is correct; some scripts depend on others, so for example you’ll want jQuery right at the top, then perhaps jSON and jQuery UI, then finally your own theme scripts.

Change server software

Most of us understand Apache to be the “web server” software that most sites run on – but it’s certainly not the only web server software out there. NGINX is a faster alternative – we use it here at MakeUseOf. WordPress is able to run fine on NGINX, though you’ll need to read up on correctly configuring the site. There won’t be .htaccess rewrites anymore, for instance, which WordPress uses to make pretty permalinks – the same is achieved in NGINX config files. [Performance test graph from Joe Williams]

nginx   Vroom, Vroom: A Comprehensive Guide To Speeding Up A WordPress Blog

Memcached and APC are additional caching systems that you can install on your server – various caching plugins can then take advantage of this within WordPress, such as w3 Total Cache or WP SuperCache. However, beware that this is pretty advanced, and you may end up breaking your VPS if you do something wrong; be sure to do a full system image backup of your VPS before attempting these kind of adjustments – the same goes for NGINX. These changes are out of the scope of this article, but a Google search for “how to install memcached on mediatemple” or your host will do the job nicely.

Prevent false requests

CloudFlare is a wonderful free service we’ve talked about before and one of my essential installs on any new site. It acts as a quasi-CDN to cache some of your pages, and also places a firewall between your site and the incoming requests by replacing your hosts DNS. This means it can capture and prevent malicious scans, bots and such from ever reaching your site; freeing up your bandwidth for genuine users. Implementing this is as simple as changing the DNS settings; or if you’re hosting with MediaTemple, my favorite VPS provider who recently acquired the CloudFlare service, it’s a one-click setup in your account settings.

cloudflare stats   Vroom, Vroom: A Comprehensive Guide To Speeding Up A WordPress Blog

Make things static

WordPress blogs are dynamic and database driven – that means that each time someone views your site, WordPress will run around gathering what it needs from the database and generating the page. But realistically, the page doesn’t change that much, unless you update it or someone adds a comment. So why serve a fresh copy each time? This is the core function of caching plugins w3 Total Cache and WP SuperCache. If you want to take this to an extreme though, WP Static HTML Output will generate completely flat HTML files of your entire site. You can even use this plugin to create your WordPress site offline, then upload the finished compiled site anywhere. It’s important to bear in mind that dynamic page elements stop working when a page is cached – so look to third party Javascript solutions, such as LiveFyre or Disqus, for commenting.

Cut down on plugins

Yes, I realise the irony of suggesting you remove plugins in an article about which are the best WordPress plugins to install. Removing plugins need not mean losing functionality though: consider alternatives such as embedded Javascript polls instead of a polls plugin; or consider hardcoding some of the functionality  straight into your theme files.

For instance, instead of having an entire plugin just to add some share buttons at the end of each post, open up the single.php template file and learn how to add them yourself. Instead of hosting your own image gallery, consider uploading Flickr then using widgets to display them.

Does this really help with speeding up WordPress? Yes – every plugin you have needs to read a set of options from the database each time it runs, all of which slow down the core page load times. The more things you can remove from this chain, or offload elsewhere entirely, the faster your blog can run.

Summary

I set out to provide a comprehensive overview of all the ways of speeding up a WordPress blog, and I’m pretty certain I’ve achieved that. If you think I’ve missed something, I’d love to hear from you in the comments. If you appreciate this post, please share it with your friends, and be sure to check out all our development focused articles.

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

11 Comments -

0 votes

mediatemple

Hey James! Very cool article, I’m sure a lot of people out there will find this useful. I get a lot of questions on this topic throughout the week and know for a fact this is a commonly searched topic. Thanks again for putting in the work :)

Drew J
(mt) Media Temple
@MediaTemple

0 votes

Rahul Saigal

Wow excellent article James…worth bookmarking…can you guide me how to implement
1. Nginx in Joomla?
2. What is your experience in Amazon CDN?
3. I heard about MaxCDN a lot, and i know how to implement in joomla, do you have any article on how much MaxCDN improves website performance or performance analysis?

I hope i am not asking too much..thanks and keep writing

0 votes

James Bruce

Sorry Rahul; NGINX is not something I handle here, we have a server guy called Alex who does that – does this official doc page not help? http://docs.joomla.org/Nginx.

I also never touch Joomla on principle – the whole project is just horrendous with very little support and documentation; hundreds of outdated plugins.

As for performance of CDNs, that will entirely depend upon your individual setup, so it’s best just to give it a go I think. You can buy 1TB of transfer for $35 I thinnk, so it’s really not that expensive (4 months on and I still haven’t used all the bandwidth!)

0 votes

Rahul Saigal

Thanks for your reply..yes i didn’t get any proper doc on nginx..i have already taken a look to that link..but no use

I agree joomla docs are horrible..but the release cycle and features are progressing fast..we have encountered joomla 3 entirely based on twitter bootstrap, and who cares about outdated extension..it has got some popular extension which is more than enough..let me know if you can get any more info..

thanx

0 votes

DB

awesome info…Thank you!

0 votes

Mac Witty

You saved my weekend! Realize there is a lot to do on websites which now loading too slowly. It is easy to add things but to remove and minimize harder.

0 votes

Tim Knight

I’ve been using CloudFlare via Dreamhost for a short while; seems to be stable and a little quicker – but it’s only the stats that tell me so :-)

0 votes

illegal3alien

To check your progress, GTMetrix and Site-perf are both great tools. GTMetrix uses Page Speed and Y!Slow and provides a chart of the results of both and suggests optimizations to help speed things up. Site-perf shows a waterfall view of all the resources requested/loaded when you visit your website.

0 votes

Boni Oloff

Great ideas, complete reference for more advance wordpress, but spend 40USD a month is very high price, unless you do it corecctly..
I mean for a website that only for personal blog 40USD is much money. But if you are talking seriously about bussines than you should consider speed more..

0 votes

James Bruce

Not necessarily for business, but if you’re passionate about web developing and own 10+ domains to play around with, a VPS is the best route to go.

0 votes

Boni Oloff

Oh yes, many web will save the money.
I just have 3 blogs, will try all the tips you said here. I know how to implement all you said, but i have no knowledge about server side software, changing apache to nginx. I think it is already installed, but i use shared hosting, so i never touch knowledge about it.