Title: cache invalidation
Last modified: June 27, 2023

---

# cache invalidation

 *  Resolved [wpshushu](https://wordpress.org/support/users/wpshushu/)
 * (@wpshushu)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/cache-invalidation/)
 * When object cache is enabled, do all SELECT statement results are cached and 
   fetching of those results are redirected to Redis or just ones for triansients?
 * What if a database record is updated, for example an option value in wp_options
   is changed, will the update automatically invalidate the cached value in Redis?

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

 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/cache-invalidation/#post-16854471)
 * No, not all `SELECT` sql queries are cached. WordPress itself determines which
   queries are cached and when they are invalidated.
 * If you run any `insert`, `update` and `delete` queries they are never cached.
   You must use WordPress’ API function to update and retrieve information. Like`
   get_post()` and `update_post()`.
 *  Thread Starter [wpshushu](https://wordpress.org/support/users/wpshushu/)
 * (@wpshushu)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/cache-invalidation/#post-16854627)
 * Can a cached object fail to invalidate when it should?
 * For example, when a plugin changes the value of an option in wp_options via standard
   WP API (I suppose update_option(…) in this case), is it guaranteed that the corresponding
   cached object(s) – ones that involve this option key will be invalidated immediately?
    -  This reply was modified 2 years, 11 months ago by [wpshushu](https://wordpress.org/support/users/wpshushu/).
 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/cache-invalidation/#post-16854657)
 * > Can a cached object fail to invalidate when it should?
 * Yes, some 3rd party plugins are poorly made and it may fail.
 * > For example, when a plugin changes the value of an option in wp_options via
   > standard WP API (I suppose update_option(…) in this case), is it guaranteed
   > that the corresponding cached object(s) – ones that involve this option key
   > will be invalidated immediately?
 * No, all the `*_option()` function will correctly update the cache. In fact all
   core-wp function work great with object caches: [https://developer.wordpress.org/reference/](https://developer.wordpress.org/reference/)

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

The topic ‘cache invalidation’ 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/)

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