lscache_wp icon indicating copy to clipboard operation
lscache_wp copied to clipboard

ESI stopped working (tag not flusheable)

Open hcarsten opened this issue 7 months ago • 12 comments

I have a setup working for the last 4 year which no problems. Basically we are dropping esi-fragments for price-information into a wordpress-pages and posts. basically all prices are tagged with "tag_price" and more generic tags like "tag_price_beamer" or "tag_price_tvset". When never prices are availiable we drop/flush the tag. Later a (self-brewed) crawler will tick the pages for to refresh esi-fragments in the pages. The same procedure was running for about 4 year. From a couple of days ago we recorded to following issues:

  • the flush of the tag seems not to invalidate the esi-fragment cache

  • if the entire ls-cache is flushed the data is refreshed

  • just flushing a single page-url will not work

  • additionally the crawlers runs are 6-10times longer and produce a lot of more load on the server.

The seems to be entirely related with the 7.x release. The same servers runs the stage- but the prod-instances. The ls-cache most updated first on the stage-instance. Whereas the problem started on the prod-instance BEFORE this instance was updated.

This there a way to clearly check within a html-page if esi is working ? Or can I check somehow if and how many fragments are in the litespeed esi-fragment cache. We are using REDIS for the object cache; are the esi-fragments also stored in REDIS ?

thx for your help

hcarsten avatar Apr 25 '25 21:04 hcarsten

@hcarsten are you able to reproduce the issue on a test server? Please describe me how you test the issue, so I can reproduce it.

Also, please share a report ID with "Passwordless Link" completed. Can you make the link multiple usage and do not expire.

Share only the ID, do not write extra info, for security reason.

timotei-litespeed avatar Apr 28 '25 17:04 timotei-litespeed

share the report from a test Server

timotei-litespeed avatar Apr 28 '25 17:04 timotei-litespeed

please try this:

enable debug log , with debug include URI lsesi , then purge all , open any page that contains ESI , you should see some lsesi=xxxx query string URI shows up in the log , that should also show the tag it attached

qtwrk avatar May 02 '25 15:05 qtwrk

@qtwrk @timotei-litespeed when you say "enable debug log" which one you mean (litespeed or wordpress LS-cache). We are on a managed server without access to the webadmin (for ls). Can the debug-parameter also given in the .htaccess or when we emit the esi-marker ?

hcarsten avatar May 03 '25 13:05 hcarsten

it's in wp-admin -> LiteSpeed Cache -> Toolbox -> Debut setting

set :

debug log to ON debug level to Advance debug include URI lsesi

then purge all , open any page that contains your ESI

then go to Toolbox -> Log View , check if you see any ESI request and what is the tag attached to it

qtwrk avatar May 03 '25 16:05 qtwrk

I did still not got this working and we made numerous sessions to trigger down the problem. The entire setup was working till a couple of weeks ago. The weird thing that we encountered lately was that we had an extra functionality in the wordpress admin BE which is using the litespeed_purge-action to flush a "tag" (so in fact every connected to the tag). And here everything works as it should ! BUT in the real-scenario we are working from inside wp-cli task and here the class Purge seems to working differently than in the website backend !

I think this was working in the past, so is there a way to trigger and immediatly process a flushing from within the a wp-cli task ?!?

hcarsten avatar May 11 '25 12:05 hcarsten

you can send a random request via curl in CLI to trigger the purge , like curl -XGET -I https://your_domain.com/?random_string

qtwrk avatar May 11 '25 12:05 qtwrk

does not really changed anything; still the same problem that in the BE it works and on the cli NOT. Or does it really matters that the url is "/?random_string" ?

hcarsten avatar May 11 '25 12:05 hcarsten

yes, you need to put something like a random string, to bypass cache and hit the PHP execution

qtwrk avatar May 11 '25 12:05 qtwrk

right as you frontend page is cached this would not work at all :( so maybe I would need to create a kind of API call to the backend. Or trigger an extra page that is not cached, or ?

hcarsten avatar May 11 '25 14:05 hcarsten

yes, that's the part random string comes in to hit a uncached page , and triggers the PHP

qtwrk avatar May 11 '25 14:05 qtwrk

what I now did is creating a shortcode that is dropped into a "non-cached" page. Here I will do the flushes for the tags. The page it self is then called with CURL out of the wp-cli task.

hcarsten avatar May 11 '25 16:05 hcarsten

@hcarsten any news here?

timotei-litespeed avatar Jul 03 '25 11:07 timotei-litespeed