KCW Cache

The KCW Cache plugin generates a static HTML version of pages and serves that to any user that is not logged in and doesn’t have an active basket.
This means that once a customer adds an item to their basket, or logs into their account, they will not receive the cached version of the site. This stops any issues with differing price list prices, different currencies, etc and makes sure that the cached version is always the base version of the site.
NOTE: This is totally separate from other caches that we use, such as the category structure cache, as those other cached items are still used as normal by logged in users, etc.

Automatic Clearing

The KCW Cache plugin has been written to integrate fully with Wordpress and Khaos Control Web, and to this end it has a number of triggers that will automatically clear specific parts of the cache, so as to keep the website as up to date as possible.
When an order is placed, the cache files for all of the products are cleared, so as to avoid any issues with incorrect stock levels, etc.
When you save a Page in the CMS, the cache for that page will be cleared, so that the changes you make will immediately show up.

Accessing the KCW Cache Settings

You can access the main KC:Web Settings by going to “KC:Web Settings” -> “Available Options” on the left-hand menu.


You will then need to click on the “Cache” tab to switch the view to the options for this plugin.


Available Options

Cache Time: Set the amount of time the cache should last for. Once this time has expired the cache will refresh with the next page load.

Enable Page Caching: Select whether to enable caching on the site, this is a prerequisite for all other options.

Enable CSS Inline Caching: Select whether to enable optimisation of the stylesheet files. This will collate all stylesheets used on the site and insert them into the page content to avoid having to load the files separately.

Enable JS Inline Caching: Select whether to enable optimisation of the JavaScript files. This will collate all JavaScript files used on the site and insert them into the page content to avoid having to load the files separately.

Enable CSS File Caching: Select whether to enable the alternative optimisation of the stylesheet files. This will collate all stylesheets used on the site into a single file, and load that during the page load. This is generally used for debugging issues, or if there is an issue with loading the stylesheet files inline. The Inline option will be prioritised if both options are enabled.

Enable JS File Caching: Select whether to enable the alternative optimisation of the JavaScript files. This will collate all JavaScript files used on the site into a single file, and load that during the page load. This is generally used for debugging issues, or if there is an issue with loading the JavaScript files inline. The Inline option will be prioritised if both options are enabled.

Enable Image Optimisation: Select whether to enable the image optimisation. This will replace the URLs for all images with WEBP versions, which is a more optimised image type, as long as the browser is compatible with WEBP files. If the file is part of the theme then a WEBP version will be generated and saved within the theme, and if it is a product/category image loaded from your Image site, it will generate a WEBP version in the same way as it generates the specifically sized versions of images.

Clearing the Cache

If you make changes to the category structure, or product data, and want to update the site straight away rather than waiting for the cache to expire there is a new option in the CMS’s top banner to allow you to do this. Simply log in and click the “Clear KCW Cache” button and all of the cache files, for all sites in the Wordpress Network, will be removed and regenerated on the next page load.


Did you find this article helpful?