Support » Plugin: WP Super Cache » Opt out of cache when WooCommerce cart isn’t empty

  • buzut

    (@buzut)


    Hi!
    Really wonderful plugin that I’ve been successfully using on countless sites for years.

    I’ve encountered a situation when using WooCommerce, eventhough cart and checkout pages are not cached by defaults, when there’s a “mini-cart” in the header, unless it’s synced after inital page load by an AJAX query, as the page is cached, the mini cart article count and content are always empty, as they are returned as part of a cached page.

    To circumvent this issue, I have added “woocommerce_items_in_cart” in the .htaccess so that this line:
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$ becomes RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_|woocommerce_items_in_cart).*$.

    It works like a charm, but I’d be really awesome for all WooCommerce users to have a related options in the configuration section.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Opt out of cache when WooCommerce cart isn’t empty’ is closed to new replies.