ESI causes problems with Query Monitor




Wordpress LScache Plugin: ESI causes problems with Query Monitor

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi. I was using ESI for long time and it was working fine but recently Query Monitors frontend functionality became affected by ESI. When ESI is on I cant open any of QM menu items ? the plugin is working, menu is there, but when I click one of its items nothing happens. I am using latest stable version of Litespeed and QM, WP ver. is 5.6.2. There are no errors in browser console. Also I have had troubles debugging the issue because I expected ?LSCWP_CTRL=NOCACHE to disable cache completely, but actually it does not affect ESI. Later I saw it in the headers and was quite surprised. This is rather strange, why it is designed that way? Hi, Could you please try /?LSCWP_CTRL=before_optm ? Best regards, I already tried it as well. Same result. Header is also x-litespeed-cache-control: no-cache,esi=on. Hello @titsmaker, Congratulations, you have helped us identify a bug. Yes, it logically makes sense that when the page is set to no-cache then esi should be disabled for this page. Thank you for the report. Will put it to our list for fix. I am glad to hear that you gonna fix NOCACHE behaviour. But I am still struggling with my original problem with Query Monitor. About the QM not working with esi on issue, I suggest you ask the QM dev team. This is a known issue for QM. Frankly speaking I myself had this issue as well when I was using QM. You could also find other peoples reports regarding this issue with QM. Does this plugin call fastcgi_finish_request? If so, thatll be whats breaking QM and itll break any other plugin that triggers output inside a shutdown handler too. Thanks @johnbillion for the hint. As far as I know, from the LSCWP plugin side, it does not call fastcgi_finish_request. But are you sure this is caused by LSCWP? Any other hint? If you have maybe I can have further check. Thought its from QM side so didnt check further in the past. Thanks for your reply. As ESI will make adminbar a separate request to server side, I think the cause of breaking is QM cant address and parse the whole page as before. The queries it can count will be only the ones in that ESI request, while not the parent page. Here is the fix https://github.com/litespeedtech/lscache_wp/commit/49c49449376f5d9e0eda5a63e7a90cccb15cab9a Hope that can help. Greetings @johnbillion & @titsmaker : Thank you for bringing this up, especially thanks for Johns attention. Because of your effort, now the issue got resolved and I could enjoy QM for those pages again! You can try it with LSCWP dev branch v3.7 rc24 (the latest one as of today) if you want. Append the query string LSCWP_CTRL=NOCACHE will bring QM to function again. Please just bear in mind that, due to code base changes, to update to latest dev branch smoothly we have to upgrade to latest master branch(v3.6.4) first if you are using the master branch. The latest master branch is already in WP marketplace as of today. Cheers and best regards, Abe



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference