• Resolved Pyetro

    (@subfighter3)


    Hello there,

    I have the same exact issue reported in this other thread.

    I confirm I have LITESPEED_SERVER_TYPE = LITESPEED_SERVER_ENT variable set, and that I need to return a value and not directly print via echo, as suggested in your ESI guide.

    Since the other thread has been closed with no solution, I’m wondering how to solve my problem.

    Basically I have an object with multiple array containing images and their caption, on each refresh the page should show a different cover splash image and sentence, unfortunately has been cached. On my local machine (where no Litespeed is installed) it works perfectly, while in the Production env the strong Litespeed cache prevent this logic to work.

    Do you have any suggestion? or can you make public the resolution applied in the other thread?

    Thanks in advance

    The page I need help with: [log in to see the link]

Viewing 7 replies - 16 through 22 (of 22 total)
  • Plugin Support qtwrk

    (@qtwrk)

    https://github.com/litespeedtech/lscache_wp/blob/75fbc8028b510514228d9a8526c0e9f91cb2a0fc/src/esi.cls.php#L531

    the code shows esi:include , please double check the same line on your system

    and try change it to something , just say esi1:include , log again , see what it outputs

    Plugin Support litetim

    (@litetim)

    @subfighter3 there is not a clear pattern because of main page being cached.

     where I only get the image ID, then the wp_get_attachment_image is crucial to render the proper <img> tag with all the proper srcset/sizes which are different from image to image.

    – cache each slide data in JS object using WP functionality: https://dev.to/hisman/how-to-pass-php-variables-to-javascript-in-wordpress-4e33 and create a JS shuffle($covers); that will change slider image and text on each page change
    – create a transient with the data and load it in JS variable(transient is saved for x days, and can be loaded faster) + the page is cached.

    Making a ESI block will create a WP request, which is more heavy than get data for the sliders

    • This reply was modified 7 months, 4 weeks ago by litetim.
    • This reply was modified 7 months, 4 weeks ago by litetim. Reason: clarifications
    Thread Starter Pyetro

    (@subfighter3)

    @qtwrk tried to change my plugin as you said

    but I stil get the same <include>

    Plugin Support qtwrk

    (@qtwrk)

    you have weird case, what if you change the src to something like src1 instead of esi1 ?

    Thread Starter Pyetro

    (@subfighter3)

    Definitely weird! But I found what was causing the problem!

    Thanks a lot for letting me focus on the real problem: there was sth else parsing the code before rendering, that’s why the include tag was mispelled…

    Well the problem was entirely caused by Iubenda plugin, and this is not the first time they make changes to the plugin, wasting tons of my time! I kind of hate them, day after day a bit more.

    I tweaked into that plugin settings setting them like this:

    I think it was the script blocker prior the cookie consent, kind of required by law, and often messing up JS scripts, but this is the first time it messes up PHP code! It was totally unexpected.

    So, thanks a lot @qtwrk and @litetim for your super fast and kind support, in the end, even if not directly, this interaction made me think laterally and I found out what other parser was messing up the code.

    I hope this thread could be useful for future Iubenda (or cookie solution plugin in general) haters ??

    • This reply was modified 7 months, 4 weeks ago by Pyetro.
    Plugin Support litetim

    (@litetim)

    @subfighter3 nice finding
    I created a staging site and I was able to reproduce the problem very easy
    I will try to contact Iubenda and resolve the issue.

    Thank you for contacting us.
    Is there any further things we can help you with?

    Thread Starter Pyetro

    (@subfighter3)

    @litetim thank you for directly dealing with Iubenda about this!
    I hope that your collaboration avoid possible future issues.

    Everything else is running smooth, but thanks for asking.

    Enjoy the rest of your day ??

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘array_rand/shuffle result is being cached’ is closed to new replies.