• Resolved Livux

    (@livux)


    Hi!

    is there a way to ‚exclude products‘ by WooCommerce from Purge?
    I have 700 products and i Dont want any site to be purged, otherwise its really slow.

    Thanks so much!

    I tried adding this, but somehow it still purges the products somehow:

    add_action('woocommerce_update_product', 'lscwp_suppress_purge_product_update', 10, 2);
    function lscwp_suppress_purge_product_update($product_id, $product) {
      ob_start( function($buffer) use ($product_id) {
        @header("X-LiteSpeed-Purge: " . LSWCP_TAG_PREFIX . "_Po." . $product_id . "," . LSWCP_TAG_PREFIX . "_WC_S");
        return $buffer;
      } );
    }

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Livux

    (@livux)

    X-LiteSpeed-Purge: public,6b8_UCSS.9cde3231c67ee69986ec73ba47eab5fe => LiteSpeed\LSC->send_headers()@560 => WP_Hook->apply_filters(ARRAY)@307 => WP_Hook->do_action(ARRAY)@331 =>
    /var/www/vhosts/esx-scripts.com/public_html/wp-includes/load.php@476

    What do you think will happen if cache for product pages are excluded from being cached, but categories or search result pages cache is purged and you make any changes at the product details?

    Plugin Support qtwrk

    (@qtwrk)

    @header("X-LiteSpeed-Purge: " . LSWCP_TAG_PREFIX . "_Po." . $product_id . "," . LSWCP_TAG_PREFIX . "_WC_S");

    this line here is exactly what tells the server to purge the product page cache

    change it to

    @header("X-LiteSpeed-Purge: "nothing");

    this will suppress purge for ANY page when you update a product

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

The topic ‘exclude products from purge’ is closed to new replies.