Wordpress LScache Plugin: Customizer not working with ESI enabled
Last Updated on: Wed, 15 Apr 2026 00:00:02 ESI doesnt work with widgets anymore after they were changed to blocks. Editing widgets as blocks doesnt show option to use ESI for a particular widget. After adding code snippet to remove the block-design from widgets in customizer, the ESI option is shown, but changing it has no effect, loading animation appears and nothing happens, it keeps on spinning. The default ESI option, Private, works though. When turning debug log there are no errors that would explain it. Is it possible to change it in database directly or something similar? Trying to get it to work with Recently viewed products widget which was working as expected and now it doesnt. This topic was modified 1 year ago by victorove. Since I cannot edit the original post. Edit: Weve done the standard troubleshooting to exclude plugin conflict and with only LS Cache and WooCommerce turned on it still doesnt work the way it should. Its not possible to control ESI option for widgets from customizer, but the default ESI setting for widget works as intended. 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 @CacheCrawler. 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. 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, its 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 ) Its 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 thats the case, please create a ticket from the link I gave above. Its not supposed to be this way so we may need to check into your site with more specific information.
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference