• Resolved CamZL1

    (@danishhaidri)


    Is it possible to use LiteSpeed Cache plugin with SL? Any conflicts? So far we are using both as a trial and what we have seen is that there is no option to clear the SL cache. As a result, we have content updated ie font color changed in WP Admin which is NOT showing on the front end. We have cleared all LSC including Cloudflare & browser cache, but the issue persists. Any suggestions on how to resolve the issue? PS this is a membership site.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    The only cache in Speculative Loading is the browser cache. It holds onto prerendered/prefetched pages just for a maximum of 5 minutes (in Chrome). So there is no cache to clear.

    Plugin Support tunetheweb

    (@tunetheweb)

    That’s not strictly true Weston.

    Speculation Rules basically uses the memory cache, so it can also be used for resources that aren’t cacheable in the HTTP Cache. As I often say it’s like right clicking a link and opening it in a new tab but not switching until later. In that case you wouldn’t expect the other tab the user opened to be closed when state changes and that doesn’t happen for Speculation Rules pages either.

    However, it will only live for the duration the user is on the page (unless it’s saved in the HTTP Cache too as usual) so there is no long term cache.

    To cancel a speculation you need to move to another page, or remove the speculation JSON from the page (which needs to be done through JavaScript and is not something the plugin can do since it doesn’t know what triggers that removal need).

    However, it seems the OP has a longer term issue here so seems like it’s completely separate to speculation rules maybe?

    Thread Starter CamZL1

    (@danishhaidri)

    Hi Guys, thank you for the quick reply.

    (please let me know if I should create a new string for this for other users)

    Will this plugin effect Logged in users? Can an exclusion be made for logged in users? At the moment we have Cloudflare + LiteSpeed Cache + SL (trial). We dont want logged in users seeing outdated content specially those who perhaps visited a page and did not close their browser and continued browsing the next day. (hypothetical scenario)

    • This reply was modified 7 months ago by CamZL1.
    Plugin Author Weston Ruter

    (@westonruter)

    Barry can speak to the specifics of how likely the prerendered content will persist (e.g. into the next day).

    We have an issue open to consider disabling speculation rules from being added by default when a user is logged-in: https://github.com/WordPress/performance/issues/1157

    Plugin Author Weston Ruter

    (@westonruter)

    For now if you want to prevent speculation rules from being printed on the page for logged-in users, you can use the following plugin code:

    <?php
    add_action( 'init', static function () {
    	if ( is_user_logged_in() ) {
    		remove_action( 'wp_footer', 'plsr_print_speculation_rules' );
    	}
    } );

    Plugin Support tunetheweb

    (@tunetheweb)

    If a page is backgrounded (e.g. switching tabs) for more than 3 mins it cancels the speculations. Would need to test whether locking the computer counts as it being backgrounded.

    Thread Starter CamZL1

    (@danishhaidri)

    @westonruter thank you for sharing the PHP. It has been added.

    @tunetheweb please do let me know how the test goes.

    Thank you both.

    Plugin Support tunetheweb

    (@tunetheweb)

    For prefetch, it follows Chrome’s 5 minute timeout, so your next day issue shouldn’t be a concern.

    For prerender, there is no timeout as long as the page is in the foreground. And sleeping the computer does not count as backgrounding. I’ve raised this issue to see if we should improve this: https://issues.chromium.org/issues/335924597

    For now, if you have those specific concerns, prefetch may be the better option for you. It won’t quite be an instant navigation, but should still provide a good headstart anyway.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘SL & LSC’ is closed to new replies.