• Resolved nemi5150

    (@nemi5150)


    I am having some odd behavior with some queries that is hard to pin down. We recently installed redis on our wordpress server running woocommerce. I had some users seeing stale information in their shopping cart and it is from a query in our plugin. The plugin does a simple sql query and stores that info using wp_cache_set. When the function starts it calls wp_cache_get to see if the info is present uses that if it is.

    I am trying to wrap my head around what your plugin is doing vs what redis does on the backend. Are you caching sql calls to the database? are you caching wp_cache_get calls? At what layer are you caching info? The tech for our web host told me that Redis was already caching sql calls and that the plugin was not needed for that, so I am assuming you are NOT caching sql results? Any clarity on what is going on behind the scenes would be appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter nemi5150

    (@nemi5150)

    For what it is worth, I commented out the wp_cache_get/set calls and the odd behavior goes away. Unfortunately, removing all of them from our code is a non-starter, plus I am sure woocommerce uses many of these calls throughout it’s code.

    • This reply was modified 2 years, 3 months ago by nemi5150.
    Thread Starter nemi5150

    (@nemi5150)

    Also for what it is worth, the wp_cache_get/set calls are not using a null/empty string/false key, as per the bug you found.

    My understanding is that the wp_cache_get/set calls were supposed to be scoped to the current running php script only and that it is not saved across calls/users. But it seems like your plugin IS saving it across php calls/users. Am I interpreting this correctly?

    Plugin Author Till Krüss

    (@tillkruess)

    Are you caching sql calls to the database?

    No, all this plugin does is provide the wp_cache_*() to WordPress/WooCommerce to store and retrieve data from Redis.

    Plugin Author Till Krüss

    (@tillkruess)

    But it seems like your plugin IS saving it across php calls/users. Am I interpreting this correctly?

    No you are not. This plugin is not doing anything. It’s only an API for WooCommerce/WordPress to communicate with Redis Server.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cache issues’ is closed to new replies.