Enable cache plugins with WordPress staging

Review on how to enable and use cache plugins with WordPress staging

This tutorial will review the configuration of caching plugins on your WordPress staging websites. There are multiple options for available caching plugins in WordPress for better loading time of your website. The important thing when you push changes is to clear the cache, so you can ensure that you see the updated content properly.

 

The SitePush staging for WordPress allows automated purge of the cache on your website, so you do not need to perform that manually after each change. This is a good feature that will definitely save you time.

 

When you install a caching plugin on your website, the SitePush staging will notify you that you need additional configuration so it could work normally. The message will say that you need to define the cache directory in the staging configuration file.

 

WordPress Staging Cache Warning

 

What you need to do, is to access the staging configuration file on your account and define the cache directory properly in it. This will allow SitePush to clear the cache each time when you push changes.

 

Edit Files

There are two ways of editing files on the server - using an FTP client, following our FTP tutorial, or editing directly through your cPanel account > File Manager, following our cPanel tutorial.

 

Open up the staging configuration file and add a new section, which will apply for all WordPress installations, configured with the staging plugin:

 

[all]
cache = yes
caches[] = /home/example/public_html/path-to-cache-directory
caches[] = /home/example/public_html/path-to-second-cache-directory

 

The options available in the new section are:

 

  • [all]: This defines that the new section applies for all websites that you have configured with the staging plugin.
  • cache: States that your websites are using cache plugins.
  • caches[]: The path to the cache directory for one of the websites configured with a cache plugin. Note that you can define as many cache paths, as you have websites configured with the staging plugin.

 

If the configuration of the caching plugin on your website is set properly. You will no longer see the warning message, once you log into the administrative area of your website.