Title: Cache issues
Last modified: August 19, 2022

---

# Cache issues

 *  Resolved [nemi5150](https://wordpress.org/support/users/nemi5150/)
 * (@nemi5150)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/cache-issues-19/)
 * 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](https://wordpress.org/support/users/nemi5150/)
 * (@nemi5150)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/cache-issues-19/#post-15933248)
 * 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 3 years, 9 months ago by [nemi5150](https://wordpress.org/support/users/nemi5150/).
 *  Thread Starter [nemi5150](https://wordpress.org/support/users/nemi5150/)
 * (@nemi5150)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/cache-issues-19/#post-15933265)
 * 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](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/cache-issues-19/#post-15933347)
 * > 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](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/cache-issues-19/#post-15933349)
 * > 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.

 * ![](https://ps.w.org/redis-cache/assets/icon-256x256.gif?rev=2568513)
 * [Redis Object Cache](https://wordpress.org/plugins/redis-cache/)
 * [Support Threads](https://wordpress.org/support/plugin/redis-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/redis-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redis-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redis-cache/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/cache-issues-19/#post-15933349)
 * Status: resolved