Ensuring that Onyx cache is working
This guide explains how to check that chaching is working correctly for your Onyx site. It includes checking if the LiteSpeed cache plugin is installed, that there are no other plugin conflicts and verifying your content is being served from cache.
LiteSpeed Cache plugin
The LiteSpeed Cache WordPress plugin is installed on all sites by default. You will see a banner in your sites dashboard if the cache plugin is not installed.
You can either use the Click here link in the banner or reinstall via Settings > Tools > Reinstall default plugins.
Ensure the LiteSpeed Cache plugin is enabled, from with the WordPress dashboard:
Click LiteSpeed Cache on the left menu
View the General tab
Also check for a notice above this regarding cache conflicts. If there is a notification here regarding another plugin using advanced-cache.php, LiteSpeed Cache will not work. Some plugins that interfere with this include:
- WP Rocket
- WP Super Cache
- WP Fastest Cache
- W3 Total Cache
Such plugins should be disabled in favour of Litespeed Cache. Once done, Purge the cache (via the Plugin or Settings > Tools > Caching in the Onyx Portal) and ensure the conflict message is no longer there.
You can verify that cache is working using browser dev tools or the curl command line utility
This Krystal article explains how to access various browser developer tools - link opens in a new window. You'll need to switch to the Network tab.
Reload the page in your browser - Ctrl-F5 on a PC or Command + R on a Mac.
Under the Response Headers section you'll see a key of x-lsadc-cache with the value of either hit or miss.
Hit means that the page is being cached.
You can also check other items (for example specific files like images or css/js files) under the File column to see if those are being cached.
curl -I https://example-domain.com and check the x-lsadc-cache header. Make sure you're using the final URL otherwise you'll just see a 301/302 response for the redirect (from non-www to www for example)
Type this - replacing the site address with your own.
curl -I https://krystaldemo.onyx-sites.io
You'll see a response similar to the following:
content-type: text/html; charset=UTF-8
date: Fri, 26 Jul 2019 19:40:44 GMT