Speed is the ultimate frontier of the web nowadays. Everybody wants it, especially since Google announced that page speed is a big factor in search rankings. More recently even mobile site speed is a big factor.
So yes we need it. But there is only so much a theme (and us as theme developers) can do in terms of speed optimizations. Sure we can be careful not to do silly things like a bunch load of MySQL queries, load the right image sizes, reduce the number of requests for static resources, etc. But these are only the tip of the iceberg in terms of site speed.
The huge gains in terms of site speed are achieved outside the theme. So let’s get rolling with some tips for you.
Caching is King
When it comes to WordPress, that is a CMS that generates dynamic pages, the first and the most important thing we can do is remove the dynamic from the equation. It is a well known fact that static pages are served by the webserver much much faster (because it removes processor and MySQL speed from the equation).
In WordPress, this can be achieved with caching plugins that will generate temporary static HTML files for your pages/posts, while managing their refresh on content update.
The most used caching plugins are W3 Total Cache and WP Super Cache. We tend to lean towards W3 Total Cache because it offers more speed, although being somewhat more complicated. But both are really good and will work just fine. They still need some configuration work but nothing that an average WordPress user can’t manage.
The most important section in these plugins is the Page Cache, this one being the one that generates those static HTML files. We recommend you not to use their JS and CSS minification since it most likely will break things if not properly configured. They also offer database and object caching; we leave this to you to decide, but it won’t make much of a difference.
Nowadays sites tend to be full of images, much more so then a couple of years ago. The web has become much more visual. This raises the concern that those images might not be that well optimized, resulting in huge page sizes (1,2,3 and evem more MB).
So we need to make sure that our image file size is at it’s lowest without loosing quality of course. Thankfully there are a couple of WordPress plugins out there that focus on just this problem. They either use scripts installed on your server (like pngcrush, advpng, jpegcrush, etc — you will need to talk to your host about these) or online services that do the crunching for you.
We recommend these plugins:
Also you should be aware that when switching themes, you most likely need to regenerate your thumbnails (that are autogenerated on image upload) so you will allow the new theme to use the best image sizes it was intended to. For this we recommend these plugins: Force Regenerate Thumbnails and AJAX Thumbnail Rebuild.
A good host is worth a 1000 optimizations
There’s simply no way around this. You simply can’t expect to pay for a VW and get a Ferrari. If speed is a major concern to you then on top of your list must be getting a proper hosting.
When talking of hosting services, there are 2 cases: you can either go with a shared hosting or a dedicated one. We highly recommend you to read this in-depth analysis about the 9 best options for managed WordPress Hosting Compared.
Shared hosting is generally cheap because it allows the hoster to cram into the same physical server a large number of clients. When this happens you must be aware that your site is in a constant battle with many other sites for resources, mainly CPU and HDD speed. So you are pretty much in the hands of destiny in terms of speed. If you are lucky to not be sharing servers with some resource hungry websites, you might be good, but you never know. This doesn’t mean that there aren’t shared hosting offerings out there that offer premium speed (for the right price) taking the burden of managing your own server out of your hands. You just have to be careful and know that you get what you pay for.
The second option when it comes to hosting your precious site is the dedicated server (either a VPS or a true dedicated server). If we are talking about cloud based servers (VPS) the costs are not that big but the benefits are huge when compared to shared hosting services. The dedicated servers are generally expensive and are aimed at pros, so we won’t discuss them here. If you are not that tech savvy you may need a managed VPS that will add additional costs, but it is well worth it.
Let me give you some advantages of having your own VPS, in no specific order:
- guaranteed CPU access;
- high speed HDDs;
- lower response times (that damn time to first byte);
- you can activate server side gzip compression that will greatly reduce the size of your static resources (CSS, JS and image files);
- you can remove the cookies on static resources — cookie-less domain (you will see this popping up in Page Speed);
- you can quit using the Apache web server and go with a much speedier Nginx web server;
- you can use server-side caching (much faster than file based one);
- you can configure MySQL to your own website necessities hence more speed;
- you can have load balancers, but we are getting to technical here 🙂
As you can see most of the things that are required to get that high Google Page Speed score are out of the theme’s hands. They need server-side configuration and tools.
I hope this brief introduction into the intricacies of optimizing your site has enlighten you somewhat on the steps you need to take to increase you speed so your visitors and Google like you more.
Write us down an e-mail at email@example.com, and we will gladly assist you during this process.