• Resolved mattbeales

    (@mattbeales)


    Hi,

    We have Litespeed installed (on a Litespeed server with Layershift) on a multisite. When caching is working it’s great and pages are loading very quickly. However, the cache seems to be getting purged on a more regular basis than we are expecting, every 10-30 minutes or so.

    We’ve looked at the logs and looked at the documentation (https://docs.litespeedtech.com/lscache/lscwp/troubleshoot/#cache-purges-too-frequently) and we can’t figure out why it’s happening so often.

    I’ve sent the report: RVGMDSYQ

    Happy to provide any more info required.

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

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

    (@qtwrk)

    Query String: yith_wcan=1&query_type_colour=and&filter_colour=cream&add-to-wishlist-itemid=5743

    because this query string will lead to a purge

    if (strpos($_SERVER['REQUEST_URI'], "yith_wcan") !== false && 
    strpos($_SERVER['REQUEST_URI'], "query_type_colour") !== false &&
    strpos($_SERVER['REQUEST_URI'], "filter_colour") !== false &&
    strpos($_SERVER['REQUEST_URI'], "add-to-wishlist-itemid") !== false){
    ob_start( function($buffer){
    @header('X-LiteSpeed-Purge: nothing');
    return $buffer;
    } );
    }

    please try add this to your theme’s functions.php , see if it helps

    Thread Starter mattbeales

    (@mattbeales)

    Hi,

    Thank you for that. We’ve tried it in functions.php and we’re still getting full purges from that query string. I’ve tried limiting your snippet so that it is just looking for “add-to-wishlist-itemid”, but it is still purging.

    Is there anything else I can send you that would be helpful in resolving this?

    Plugin Support qtwrk

    (@qtwrk)

    if (strpos($_SERVER['REQUEST_URI'], "LSCWP_NONCE") === false){
    ob_start( function($buffer){
    @header('X-LiteSpeed-Purge: nothing');
    return $buffer;
    } );
    }

    if you simply put this code , how does it go ?

    this should suppress any and all automated purge call.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Cache getting purged too quickly’ is closed to new replies.