From my experience as a Support Manager, I encounter a lot of “issues” with caching plugins in WordPress. It is good to understand what these plugins do (in general) and when to use them, and when not.

How WordPress Generates Pages

WordPress is a PHP/MySQL application. PHP stands for Hypertext Preprocessor. MySQL is a database system. PHP will take the code in WordPress, combined with code from your theme’s files (e.g. index.php), reads the database (containing your posts, widgets, plugins etc.) and merge all that into a plain HTML page. HTML being the “language” that browsers can read and display. This is a dynamic process, and will be performed each time a page is requested.

What a Caching Plugin Does

In general, a caching plugin will create a “snapshot” of all your pages to reduce the time required to generate an HTML page. Once a page has been generated by the process of reading a php file, get info (your posts, widgets etc) from the database, get and insert plugin info (e.g. “related posts”), once all the information is processed and a page is put together, a copy of the resulting HTML page will be stored in a folder on your server. This process is called caching.

When a browser requests a page, it will be served from those snapshots, from cache, thus reducing the time required to generate the page, and as such optimising the site load time. As soon as you change a page or posts content, or add a new post, the caching plugin will (re-)generate the cache for that page, so that future requests will reflect the updated version.

So What’s the Problem?

There really should not be a problem, unless you are still working on your site, developing, adding plugins and widgets, perhaps modifying CSS code or theme template files to change the functionality and looks of your site. Most, if not all of these activities do NOT trigger a cache plugin to regenerate all cached pages. So when a page is requested, chances are that the version that is displayed by the browser (the previous snapshot) does NOT reflect the CSS changes, widgets appear not to have been changed, plugins seem to malfunction etc.

What’s the solution

De-activating the caching plugin during the development stage of your site, can prevent these issues. In some cases, depending on the caching plugin you use, you might also have to clear the folder with the snapshots, the cached pages, but this requires you to access your server via ftp, and you need to be sure which files to remove. Be cautious, and always make a backup. Consult the plugin’s documentation on how to do this.

Being aware of this might save you a lot of headaches and confusion and “why is my page not updating, I can see the change in my WordPress backend, but not on the page!?”.

3 comments

  1. Casey Friday

    Thank you SO MUCH for this explanation. I have been redesigning my site (creating a custom theme), and I had a caching plugin running at the same time. I thought I was crazy when the new posts wouldn’t show up, and I thought it was a PHP error. I must have changed the PHP five times before coming here, and realizing that the new PHP just hadn’t been cached yet.

    My site’s pretty light, so I just deactivated/uninstalled the plugin, so I won’t have to worry about live updates not being live in the future.

    Thanks again, so much!

  2. From my experience, for some premium WordPress themes, installing the caching plugin such as W3 total cache would conflict and make the theme to not display properly, especially if the theme comes with a slider, the caching plugin would make the slider disappear.

Leave a Reply