Choosing a good host is part of running a WordPress site, but many users wonder where to go from there. A properly optimized WordPress site can not only allow you to serve your customers better, but also greatly decreases your server loads. In the web hosting world, a few extra seconds to load your site could be the difference in converting a customer to a sale. In this article, we’ll show you how to improve server performance and page speed by leveraging things like browser caching and CDNs.
Most of these performance optimization changes can be done within the W3 Total Cache plugin, so we will reference it frequently. If you do not already have the W3 Total Cache plugin installed, you may locate it on the W3 Total Cache page on the WordPress plugin database.
Caching is one of the simplest ways to increase your site performance. Instead of your users downloading the full content of each page they visit, they will have static content such as images and stylesheets already stored within their browser for quick loading times.
If you have the W3 Total Cache plugin installed and activated, you may click on Performance within your WordPress dashboard to access its settings.
On the General Settings page for W3 Total Cache, you’ll want to enable the following settings for best performance:
- Page Cache: This option will cache individual pages within your WordPress installation. Enabling this option will allow pages to be loaded without the need to dynamically generate them.
- Database Cache: Each time WordPress loads information, it needs to retrieve the content from the database. Enabling this option will allow data to be saved locally, so there will be no need to query your database for each item. With less database queries, page generation times as well as server loads can be dramatically decreased, especially if there is a large amount of content on the site.
- Object Cache: This option allows you to cache objects that may otherwise be resource intensive to generate. If you have a lot of dynamic content on your site, this option can be especially useful.
- Browser Cache: All modern browsers have some sort of caching system built into them that is able to store data temporarily. Enabling browser caching will allow them to save the data such as images and stylesheets so that the visitor does not need to download all of the content of the page on each visit.
You may have noticed that there are several options in the Object Cache Method dropdown box. By default, disk caching is enabled. This option is great for any users on shared hosting and many others, but if you prefer to use APC or another method, you may select it here.
Minifying your CSS will allow smaller stylesheets to be sent to the user’s browser. This means smaller file sizes, and less processing by the browser. While the speed increase isn’t too significant, it’s still always a good idea to get every bit of performance available.
Just like caching, minification can be done within the W3 Total Cache as well. To enable it, jump back over to your W3 Total Cache general settings within your WordPress admin dashboard and look for the section enabled Minify. The default settings will be perfectly fine for most users so you may simply enable it and save the default settings.
Most modern browsers currently support gzip compression. What gzip compression does is compress your files so that they are smaller and therefore are much quicker to download from the server to the visitor’s browser.
Thankfully, W3 Total Cache has options for gzip compression as well. By default, it should already be enabled, but if you need to check on it or change the setting, it is within the Browser Cache page of the W3 Total Cache settings.
Using a CDN
CDN stands for Content Delivery Network. This allows your static data to be downloaded from several servers across the world, allowing for the fastest speed possible. For example, if a user is visiting your site from Europe, a European server will deliver the site content to them instead of your main server located in the United States.
Configuring WordPress to use a CDN for your static content is quite easy as W3 Total Cache has options to configure a CDN. To set up a CDN within W3 Total Cache, select your desired CDN within the W3 Total Cache general settings, then head over to the CDN page of W3 Total Cache and specify your credentials.
Now that you have enabled several things such as caching, CSS minification, file compression, and a CDN, your website should now be running faster than ever. Not only is the speed of your site increased, but your server load should be much lower allowing more simultaneous visitors without seeing decreased performance.