Support » Plugin: Redis Object Cache » redis cache problem with product variation

  • Resolved Robert

    (@roberthedlund)


    We have some problem when using redis and wondering if someone have an solution/fix. We are using WP-rocket and woocommerce_payment_complete hook when an purchase is completed.

    The problem we have is when a variation of an product is gets out of stock after a completed purchase, the product page doesn’t get purged from cache. We need manually clear redis cache everytime.

    Right now we have deactivated redis, because we don’t have time to manually login to the site and manually clear it everytime when we have an purchase.

    Any help appreciated 😊

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    Hi Robert:

    the product page doesn’t get purged from cache. We need manually clear redis cache everytime.

    This doesn’t quite make sense, Redis doesn’t cache pages, it only caches objects.

    WooCommerce is very good when it comes to object caching, so I assume the issue is in your custom code. Can you post your code that’s using woocommerce_payment_complete?

    Thread Starter Robert

    (@roberthedlund)

    Thank you for the reply @tillkruess
    You are right, my fault.

    The code is: https://github.com/wp-media/wp-rocket-helpers/blob/master/compatibility/wp-rocket-compat-wc-order-clean-cache/wp-rocket-compat-wc-order-clean-cache.php

    It’s so annoying, if we enable redis and a purchase is complete the variation on that product page doesn’t update. But if we deactivate or clean object cache the product page gets updated with correct variation like “out of stock” and such.

    Appreciate any advice 🙂

    Plugin Author Till Krüss

    (@tillkruess)

    Are you expiring the same issue when you disable WP Rocket?

    Thread Starter Robert

    (@roberthedlund)

    I have also tried that but the problem still is the same when redis is enabled :/

    Plugin Author Till Krüss

    (@tillkruess)

    I’d suggest reporting this problem to either the WooCommerce team, or see if other code on your site is causing it.

    Alternatively you can ignore the affected cache groups 👍

    Thread Starter Robert

    (@roberthedlund)

    @tillkruess I just want to let you know that I have found what caused the issue. I had totally disabled heartbeat in perfmatters. Whit that disabled the issue starts. So now its on as default and the issue is gone.

    I also tested to reduce the heartbeat, then sometimes the problem doesn’t happened but sometimes it does. So from now on the heartbeat will stay on as default ^^

    • This reply was modified 1 month, 3 weeks ago by Robert.
    Plugin Author Till Krüss

    (@tillkruess)

    Thanks for sharing Robert!

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