Since I cannot edit the original post.
Edit: We’ve done the standard troubleshooting to exclude plugin conflict and with only LS Cache and WooCommerce turned on it still doesn’t work the way it should. It’s not possible to control ESI option for widgets from customizer, but the default ESI setting for widget works as intended.
Plugin Support
qtwrk
(@qtwrk)
Hi,
please try edit file /wp-content/plugins/litespeed-cache/src/admin-setting.cls.php
at bottom of it , you will see a block
if ( ! $current || $esi != $current[ ESI::WIDGET_O_ESIENABLE ] ) {
Purge::purge_all( 'Wdiget ESI_enable changed' ) ;
}
elseif ( $ttl != 0 && $ttl != $current[ ESI::WIDGET_O_TTL ] ) {
Purge::add( Tag::TYPE_WIDGET . $widget->id ) ;
}
Purge::purge_all( 'Wdiget saved' ) ;
change it to
if ( ! strpos( $_SERVER[ 'HTTP_REFERER' ], '/wp-admin/customize.php?return=%2Fwp-admin%2F') ) {
if ( ! $current || $esi != $current[ ESI::WIDGET_O_ESIENABLE ] ) {
Purge::purge_all( 'Wdiget ESI_enable changed' ) ;
}
elseif ( $ttl != 0 && $ttl != $current[ ESI::WIDGET_O_TTL ] ) {
Purge::add( Tag::TYPE_WIDGET . $widget->id ) ;
}
Purge::purge_all( 'Wdiget saved' ) ;
}
else {
// delay purge_all to the next non-customize-widget-page request
// for temp fix, this is not big issue, leave it for later in official fix
}
this is a temp solution , we will work out a permanent solution
Best regards,
Hi @qtwrk. We have used different workaround and edited the widgets from admin panel (Appearance > widgets), which seems to ignore the caching.
Outside admin panel it seems LSC ignores the settings related to caching admin, for example links on admin bar work well while in admin area, outside of admin area LSC breaks the links that normally should be accessible.
PS. It seems there are typos in your code, Wdiget instead of Widget.
-
This reply was modified 4 years, 5 months ago by
victorove.
Hi @victorove
Thank you for the reporting. The temp fix qtwrk provided above are to fix the widget settings updating issue on the Customize page. Did you give it a try? For wp5.7.4-, this should work well.
For wp5.8+, indeed there is some more work to do. We are working on this. If you have any findings, we welcome you to report it through tickets here: https://store.litespeedtech.com/store/submitticket.php
How did you disable the widget block editor? You mentioned “code snippet”. Did you try to use the Classic Widget plugin?
BTW, yes, you had a good catch of the typo. It has been there so we just leave it there for now.
The temp fix qtwrk provided above are to fix the widget settings updating issue on the Customize page. Did you give it a try?
No, since we solved it changing widgets from admin area there was no need for that fix, besides we are on wp 5.8.2. Current findings are that the caching should be completely disabled for admin and it is not, it’s only disabled in admin area, but once you leave it, everything is cached regardless of the role, thus breaking Customizer and links in admin bar.
To disable the block editor for widgets we use filters
add_filter( 'gutenberg_use_widgets_block_editor', '__return_false' );
add_filter( 'use_widgets_block_editor', '__return_false' );
It’s only two lines of code, so we will not be using plugin for this.
Ok, basically when you disabled the widget block editor you still had the ESI problem. If that’s the case, please create a ticket from the link I gave above. It’s not supposed to be this way so we may need to check into your site with more specific information.