• When creating an ESI block, every instance is wrapped in:
    <!– lscwp Custom ESI block –>
    <!– lscwp Custom ESI block esi end –>

    I am trying to return JSON so of course that breaks.

    I have LSCACHE_ESI_SILENCE in my wp-config

    I also tried:

    add_filter( ‘litespeed_comment’, ‘__return_false’ );
    if ( ! defined( ‘LSCACHE_ESI_SILENCE’ ) ) {
    define( ‘LSCACHE_ESI_SILENCE’, true );
    }

    but the comments remain.

    I have also tried regex and even str_replace to try and remove the comments but it seems that string is no longer editable? I don’t know how that is happening.

    Any help here would be really appreciated, thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support litetim

    (@litetim)

    Try adding query string _ls_silence to the link, where data is taken from:
    test.com/page/?_ls_silence=true

    • This reply was modified 2 months, 2 weeks ago by litetim.
    Thread Starter superfrost

    (@superfrost)

    Ok I can try that, i was able to hack a few things together and get just the JSON to return but I don’t seem to be able to change anything in it, json_decode doesn’t work on it, any ideas?

    Plugin Support qtwrk

    (@qtwrk)

    add_filter('litespeed_is_json', function($value) { return true; });

    could you please try this ?

    Thread Starter superfrost

    (@superfrost)

    That did not work, my page simply rendered /r/n/r/n like that and everything broke.

    For anyone interested, in the plugin, esi.cls.php line 549 is the issue:

    if (!$silence) {
    $output = "<!-- lscwp $wrapper -->$output<!-- lscwp $wrapper esi end -->";
    }

    Commenting the $output line out fixes a lot of issues.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.