We continued our tutorial series on configuring the W3TC plugin. As a reminder, W3TC is the abbreviation of the name " W3 Total Cache which is a famous plus for caching on blog. Caching a blog means rendering data identical easily accessible for the server.

You can read our previous tutorials on the subject to find out more.

The configuration page of the cached from the base of data Menu has two sections: General and Advanced.

database-general-mise-en-cache-to-the-base-of-data

The section General "Has just one option: a check box, checked by default, which makes it possible not to cache the queries made for logged in users. What this means is that if a user is logged in, they will not have the data from the cache. The reason is that logged in users will interact with the site during their sessions. They therefore need to receive the updated data.

An exception to this would be when a contents is hidden behind a “ paywall ”, which does not change with the opening of the logged-in user. In this case, the database cached is used because users are logged in just to access the contents and not to actually interact with or modify any contents of the site.

The section " Advanced In the database menu allows you to refine the database cache. You can assign a life to objects in the cache with a default value being 180 seconds, and determine the length of time after which expired objects should be removed.

configuration-avancees-cache-w3tc

If you use the cached of the database, stick to the defaults unless the database cache becomes too large. If this occurs, reduce the cache object lifetime or garbage collection interval to reduce the amount of space the database cache takes up.

You can also specify specific pages where cached database data will not be used on subsequent pages. This is especially useful if you are making cache requests for logged in users but there are some pages where you do not want cache data to be supported.

mise-en-cache-of-the-base-of-data

The next field in the Advanced section allows you to specify which database query stems will be ignored - that is, not cached by the database cache. Use this field if you are using plugins that depend on querying the database.

For example, the field is prefilled with three values: gdsr_, wp_rg_, et _wp_session. These three requests correspond to the GD Rating System, Gravity Forms, and WP Session Manager plugins. These are three common plugins that need to directly query the database every time a page is loaded, not a cached version of the database. So adding these queries to the ignored list helps prevent these queries from being cached.

If you have the database cache enabled and notice that a specific plugin is not functioning normally, you will need to identify the associated query either by digging into the plugin code or asking the plugin author.

The field entitled " Reject Query Allows you to identify specific types of queries that should not be cached. Unless you are an administrator of the database, leave this field as it is.

That's it for the database cache configuration on W3TC. Do not hesitate to ask us questions if you do not understand a point.