• Resolved jorkory

    (@jorkory)


    Hi,

    I have the following setup:

    • ESI server is enabled
    • ESI WordPress plugin is activated
    • The page is cached

    I inserted ESI into my shortcode like this: [esi ljo_events]

    The HTML returned on the page looks like this:

    <!-- lscwp esi-shortcode -->
    <include src="/?lsesi=esi&amp;_control=public%2Cno-vary&amp;esi=WyJsam9fZXZlbnRzIl0%3D&amp;_hash=c7ae59ecfadc7626902a7d450183f36e" cache-control="public,no-vary"></include>
    <!-- lscwp esi-shortcode esi end -->

    So it renders very quickly, but it still only shows the <include> tag.

    If I access the ESI block URL directly like this:

    https://mydomain.com/?lsesi=esi&_control=public,no-vary&esi=WyJsam9fZXZlbnRzIl0%3D&_hash=c7ae59ecfadc7626902a7d450183f36e

    Then I get the full HTML content of the block.

    It seems like the ESI shortcode is not being processed inside the cached page.

    Does anyone know why the shortcode does not render the block directly when the page is cached?

    Thank you for your help!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support qtwrk

    (@qtwrk)

    it sounds like something hijacked the /?lsesi=xxx request to the full html content

    please provide the report number , you can get it in toolbox -> report -> click “send to LiteSpeed”

    Thread Starter jorkory

    (@jorkory)

    I misspoke earlier.
    When I access the ESI URL directly, e.g.:
    https://mydomain.com/?lsesi=xxx
    it correctly returns the shortcode block content.

    The issue occurs only on the cached page: the ESI shortcode in the HTML shows:

    <!-- lscwp esi-shortcode -->
    <include src="/?lsesi=xxx"></include>
    <!-- lscwp esi-shortcode esi end -->

    — the block is not rendered in the cached page itself.

    Last Report Number: DICKHXZS

    Plugin Support qtwrk

    (@qtwrk)

    <include src=”/?lsesi=xxx”></include>

    did you literally see this ? because it should be like <esi include.....>

    Thread Starter jorkory

    (@jorkory)

    Yes, I literally see <include src=”/?lsesi=xxx”></include> in the HTML output.

    Plugin Support qtwrk

    (@qtwrk)

    this sounds like somethign altered the html output

    function lscwp_debug_log_output( $content ) {
    if ( strpos( $_SERVER['REQUEST_URI'], 'test123' ) !== false ) {
    error_log($content, 3 , WP_CONTENT_DIR . '/output_buffer.log');
    }
    return $content;
    }
    add_filter( 'litespeed_buffer_after', 'lscwp_debug_log_output', 0);

    add this to your themes’ functions.php

    purge all

    open the page on your screenshot , like https://your_page/?test123 with ?test123 to trigger the logging

    once page is loaded , check the wp-content/output_buffer.log

    looking for /?lsesi and see what it was look like before sends to browser

    Thread Starter jorkory

    (@jorkory)

    I checked the output_buffer.log as suggested. The HTML shows the same <include src=”/?lsesi=xxx”></include> before being sent to the browser.

    Plugin Support qtwrk

    (@qtwrk)

    okay , could you please create a stage site and disable all plugins except the LSCWP and minimal set up , see how it shows ?

    Thread Starter jorkory

    (@jorkory)

    I cannot disable all plugins because it’s too complicated. But I used another method: I created a separate PHP file where I put do_shortcode(‘[esi ljo_events]’) and I added the route directly in functions.php. The ESI works this way, so it seems there is an incompatibility with the EtchWP theme.

    Do you have any suggestions on how to make ESI work directly in the theme pages?

    Thread Starter jorkory

    (@jorkory)

    It’s resolved! ✅ I was able to make ESI work using the short solution: creating a dedicated PHP template with do_shortcode(‘[ljo_events]’) and adding a route in functions.php. Now the ESI block renders correctly on cached pages.

    Thanks for your support!

    Plugin Support litetim

    (@litetim)

    @jorkory my colleague suggested to create a stage site(copy of main site) and test there.
    Looking over your site we saw that you use Complianz GDPR plugin. There is a know bug when banner is loaded, HTML is being changed and that disables the ESI tag. Correct tag is <esi:include … but as you see there is just <include
    You resolved your issue by not loading the banner 🙂

    • This reply was modified 4 months, 1 week ago by litetim.
Viewing 10 replies - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.