Having some type of caching system in WordPress can be a determining factor in improving WordPress loading speed, especially if our website receives many daily or concurrent visits. There are many plugins to set up the W3 total cache in WordPress. Let’s talk about them:
What is Cache in WordPress
When a web page is generated dynamically, as with WordPress, a series of processes have to be passed before returning the page that web visitors see.
First, the webserver has to interpret the WordPress php code, then it will make several queries to the database to obtain the content to be displayed. With these returned content, along with the interpretation of the php, CSS styles, and others, HTML content is generated that is returned to the user.
This process, although we see many steps in it, is very fast. But it will always take longer to execute than if an html page were loaded directly.
Caching systems try to avoid all these steps, creating an already generated view of the page to be loaded, that is, the content of the page is cached. An obvious advantage is that the time it takes to return a page is less and, as a disadvantage, cache files will be generated that will occupy space in our hosting account, the more the greater number of content our WordPress forms.
Another possible disadvantage could be that the changes we apply to the web (for example, modifying the content of a page) are not reflected immediately, although this depends on the tool we are using to generate the cache.
Using the WordPress cache would be very important if our website receives many visits per day since it is precisely when there are many simultaneous visits that the delay caused by generating the content can be noticed.
In web pages that receive few daily visits, having a cache system enabled would not be necessary. There are different cache plugins for WordPress, let’s see how to setup the W3 Total Cache plugin and how it works.
To use W3 Total Cache we must install the plugin and activate it. Then we will be ready to configure it. We are going to do a basic review of the recommended configuration options.
Once W3 Total Cache is installed, in the WordPress administration menu we will see a new Performance element. This in turn has several sub-menu items. We will enter the General settings option. To save any changes that we are going to apply from now on, we will click on the Save all settings button that we will find in different areas.
How to Configure W3 Total Cache Easily
First, in the Page Cache section of the W3 Total Cache plugin, we activate the Page cache parameter and in the Page cache method, we will select the Disk: Enhanced option. This will activate the main cache of the plugin. In this same section, we will see an Empty Cache button that we must press in case we want to empty the cache.
It can be useful in case we see that the space occupied by the cache files is too large or if we see that after applying a change on the web it is not reflected immediately and we do not want to wait for it to be displayed.
Therefore, if we activate this option we will have to check right after that the operation of the page is correct. If not, it is better not to use this option.
To activate Minify we will simply have to check the Minify box and save the changes. The other parameters do not need to be modified, leaving their original configuration.
W3 Total Cache in DataBase
Below we find the Database Cache section. This is used to cache the SQL statements that are sent to the database. Although, a priori, this can improve load times, in many cases the opposite effect will occur, due to the load, it implies on the server.
Therefore, if we decide to use the Database Cache, we will have to evaluate the loading times with this element activated and deactivated to see if we notice a significant difference. A tool like Pingdom can be used to evaluate load times.
In case there are no important differences or even the load goes slower with the Database Cache activated, it is preferable to leave it deactivated.
We want to use the Database Cache we will have to activate the Database Cache parameter. In the Database Cache Method parameter, it is recommended to select the Disk option.
The next section is the Object Cache. Its operation is similar to that of the Database Cache.
In this case, it saves objects from the database to try to speed up the load, but like the previous option, this can saturate the server’s resources, so sometimes it is preferable to leave this option disabled.
To use this option, activate the Object Cache parameter and select the Disk option in the Object Cache Method parameter.
We May Also Read: How to Disable WordPress Auto Updates
After Configure Plugin What Needs to Do
That is, save a copy on your computer. In this way, if later we reload this page or others that use common elements, that content will no longer be downloaded from the server but will be loaded directly from the browser, which implies a saving in page load times, because much less content has to be downloaded. In fact, these static files tend to be the heaviest.
With the Browser Cache option of the W3 Total Cache, we will be able to setup and control how long these contents will be stored in the browser before reloading them. For this, we will have to activate the Browse Cache parameter.
Once done we can go to Performance> Browser Cache and configure it as in the following screenshot (we can leave the default configuration, which would also be valid):
We are not going to touch the rest of the sections in General Settings.
We must be careful if we want to use this option since, if done wrong, we can make the page not load correctly or seriously damage the positioning of our website in search engines, by interpreting that we have duplicate content.
The rest of the menu items that we find within the Performance menu of the WordPress administration will allow us to further refine the configuration of all of the above, although in this entry we are not going to review each of them. The most important is Performance> Page Cache.
A priori, within the General section, it will not be necessary to change anything, since the default configuration is already valid, although we can refine some points if we deem it appropriate.
Further down, in the Cache Preload section, we will find an important parameter: Update interval. Indicates the time, in seconds, that W3 Total Cache waits to generate new cache files.
The default value of 900 (15 minutes) may already be valid, although we can increase or decrease it depending on the number of visitors to our page or the frequency with which we update content on our page.
As you have seen, several of the parameters that are configured in the W3 Total Cache do not always improve the loading speed of the web and may produce the opposite effect, so we will have to go testing until we find the configuration that best suits our WordPress.
When in doubt, it is preferable not to use the sections that may cause conflicts. You can contact us if you face any problems with setup W3 Total Cache in WordPress.