Yes – Support provided a temporary solution to this problem. I am still working with them to fix the problem with ESI.
- Disable ESI
- Create a file called nonce_purge.php in the WP root folder / same folder that wp-config.php exists with the following content:
<?php
require( './wp-load.php' );
if ( get_option("litespeed.conf_ols_purge_nonce") === false ) {
$current_nonce_tick = wp_nonce_tick();
add_option( 'litespeed.conf_ols_purge_nonce', $current_nonce_tick);
return;
}
$saved_nonce_tick = (int) get_option( 'litespeed.conf_ols_purge_nonce' );
$current_nonce_tick = (int) wp_nonce_tick();
if ( $saved_nonce_tick !== $current_nonce_tick ) {
update_option( 'litespeed.conf_ols_purge_nonce', $current_nonce_tick );
if (defined( 'LSCWP_V' ) ) {
do_action( 'litespeed_purge_all' );
}
}
3. Schedule a cron job for every 5 minutes
wget -q -O - https://www.website.com/nonce_purge.php >/dev/null 2>&1
This causes a ‘purge all’ to happen every 12 hours or when the nonce values expire. This has fixed the problems I was having that required ESI in the first place, but the problem with ESI inserting HTML comments instead of actual nonce values persists.