If you run a website, content may be king, but speed is the cook that keeps the king fed. Recently, we talked about WhichLoadsFaster, a site that compares loading times of two or more websites. How do you improve your site’s chances of being the site that loads faster?One of the best tools for speeding up sites, and one that we use here at 40Tech, is W3 Total Cache, a caching plugin. W3 Total Cache not only speeds up your site, but it can also save you bandwidth.
First, though, let’s look at how WordPress works without a caching plugin. Normally, when someone visits your site, WordPress has to build everything on the page. It does that by processing code, making calls to your database, and outputting the final content that your visitors see in their browsers. Caching strips down this process. The general idea behind caching is that much of this process will (ideally) happen once – the first time someone visits the page. The page is saved at the time of that visit, and the prebuilt version of the page is then displayed to subsequent visitors, for a predetermined period of time.
W3 Total Cache is one of the more advanced caching plugins, so it can be daunting. There are several ways that it can cache your site (all of which we’re using here at 40Tech). The caching options are Page Cache, Minfy, Database Cache, Object Cache, and Browser Cache. You can also set up a CDN (Content Distribution Network).
Most of the settings don’t require any effort at all if you have a typical shared hosting solution. I went with the default settings for almost all of the settings, and they worked without any trouble. The two exceptions to this, and the two that are the most interesting from a geek perspective, are Minify, and the CDN options.
Using a CDN is a way to distribute some of your site images and other files on servers closer to your users. This not only speeds up your site, but also saves you bandwidth. 40Tech uses Amazon’s S3 and Cloudfront, which has a global network and is so cheap it is almost free. All that I had to do was input my Amazon S3 settings on the plugin’s CDN settings page, let the plugin walk me through getting the initial files uploaded, and I was good to go.
How I Set Up the Minify Features
W3 Total Cache’s Minify feature decreases the size and number of CSS and JS files by combining them into one file. You have to configure this, though, which might make your head explode at first glance.
If you take your time and do it in steps, though, it isn’t so hard. I did it by clicking on the Help Wizard button on the minify page, and just going through trial and error. I checked the box next to a few scripts at a time, testing out the site to make sure that I didn’t break anything. Fortunately, W3 Total Cache allows you to preview any changes before deploying them to the site (by clicking the “Preview” button near the top of the plugin settings page). So, if a minfied item messed up the site, I tried it in a different location, and ultimately removed it from the minified settings if it just wouldn’t work. It took time, and eventually I had identified each piece that could be minified. This might not be the ideal way to do it, but for a novice, it works. When you’re done, don’t forget to click the “Deploy” button to have the changes go live on your site.
Are you a site owner? What ways have you found to be speed up your site?