WordPress Optimization: Use Your Server More Efficiently, Part Two

For most people, WordPress works fine right out of the box. However, when your blog becomes popular, you’ll find it can be a hog, generating timeouts, consuming massive CPU cycles and server resources. Eventually, your web host will complain, probably threatening to shut you down if something doesn’t change. Usually, they will suggest that you could buy more server space, a bigger server, or go to a dedicated host. But before you spend the big dollars, consider optimizing WordPress so it runs lean – and inexpensively.

This is part two of a three-part collection on WordPress optimization. Getting Started with WordPress Optimization describes how to prepare yourself for success. Easy WordPress Optimization provides a selection of easy things to do that will produce a faster, leaner WordPress installation. Advanced WordPress Optimization describes further tactics that useful, but require stepping outside the confines of WordPress to edit the configuration of your website.

When first installed, WordPress is designed to be usable and stable, with a focus on immediate results. As your blog becomes more popular and you become more accustomed to WordPress, you’ll want to make some changes that dramatically improve the performance of your website, and as a result, make your web host happier.

Install Caching:
This is absolutely the first thing to do to improve performance. Caching improves performance by saving copies of pages. Imagine you were throwing a party, and needed to tell your guests how to get to your house. You’d need to draw a map and give everyone a copy. One way you could do it is to draw a fresh map for each and every guest. Or – you could draw one map, make copies on a copying machine, then hand those out instead of the original. That’s exactly how caching works – the page is built for the first reader that asks for it from your website. Caching software then saves a copy of that page, and when someone else asks for the same page, the website sends the already-built copy, instead of consuming all the resources required to rebuild the page from scratch. Caching can improve your performance by two or three times.

WordPress already comes with a rudimentary caching program, but you’ll want to improve this by installing a caching plug-in. The hands-down favorites for this is WP Super Cache or W3 Total Cache . Don’t use both. To install, you’ll need administrative access to the website, and brief instructions on how to install plug-ins . Don’t panic – it’s much easier than it first looks. WordPress has a push-button interface for finding and installing plug-ins.

When you’ve installed a caching plug-in, follow all of the recommended settings. In particular, allow it to use Mod_Rewrite unless it creates absolute havoc with your site. Mod_Rewrite is a sophisticated configuration that tells your website to respond in an incredibly efficient manner. Fortunately, WP Super Cache takes care of all the ugly parts of the job, leaving you to just look good.

Again, before you do anything else, implement caching. It will be your best performance improvement.

Disable Unnecessary Plug-ins:
The WordPress community has built thousands of plug-ins, from frivolous to fantastic. Some of these were carefully designed to produce good results with clean code. Some of them are sloppy, consuming server resources with abandon and sending bloated html to your readers. Unfortunately, it’s difficult to know which is true – so it’s best to clean house.

Be sure that the plug-ins installed in your website are actually being used. No matter how well they are written, it doesn’t make sense for them to use your server bandwidth if you aren’t using the results. In the case of a website I was optimizing, there was a plug-in creating statistics on how often pages were being read – but that information wasn’t being displayed on any of the pages. I already had that information from the server logs, so this plug-in was simply chewing up CPU time to create information we would then throw away. Out it goes.

That’s not to say plug-ins are bad. Caching is good, for one. And your site may depend on a plug-in. If you find a plug-in you don’t understand, proceed with caution, observe the consequences of inactivating the plug-in, and be prepared to turn it back on if something goes awry.

Minify CSS and Javascript files:
When a web page is downloaded to your readers, it includes text and images. Less obvious is the formatting and code that is also downloaded in the form of CSS (cascading style sheets) and JS (Javascript) files. If you view the page source of a page from your website, you’ll see these in the section.

Normally, these are written in a way that is easy for humans to read. Lots of line returns, spaces and long, descriptive names so if you have to debug the code, you have hints as to what might be going on. But computers don’t need all this formatting – and it’s wasteful to send it across the internet.

In addition, it takes a certain amount of time to obtain a file from a server. Every time a reader requests a file, the server has to take time to find the file, then send it – no matter how big, or small the file is. If you have a lot of these related files, they are consuming processor time to get sent out.

Minification is a funny word for an internet concept where a lot of small files are combined into one, and then all the unnecessary parts are stripped out. Doing it by hand requires some in-depth knowledge of CSS and Javascript – but lucky you, there are several excellent plug-ins that will do this for you. Among them are W3 Total Cache (which you may have already installed in the previous discussion about caching) or WP Minify . Install the plug-in, follow the suggestions for use, and you’re done. Immediate, pain-free savings.

Content Delivery Network (CDN):
The best way to conserve your system resources is to not use them in the first place! Your theme templates may be using files that never change, and WordPress itself has core files that are always the same unless it has been upgraded. Why not have someone else supply these static files? There are companies, such at Google or Dropbox, that provide Content Delivery Networks. They are happy to provide you with free system resources. Bless their ever-lovin’ hearts.

The easiest way to implement this is with a plug-in, although more ambitious web masters can do it by hand. WordPress.org maintains a list of useful plug-ins, most notable is W3 Total Cache (previously mentioned) or “Use Google Libraries” . W3 Total Cache requires a bit more set-up, but allows for a wider range of files. “Use Google Libraries” is a point-and-click solution, taking advantage of files that are already available on Google servers.

This is the end of the second part of this three-part series. Next is “Advanced WordPress Optimization” where I’ll describe some advanced ways to improve your WordPress site performance.


People also view

Leave a Reply

Your email address will not be published. Required fields are marked *