Title: Stale in-request cache after wp_cache_flush()
Last modified: July 28, 2026

---

# Stale in-request cache after wp_cache_flush()

 *  [palsch](https://wordpress.org/support/users/palsch/)
 * (@palsch)
 * [1 week, 3 days ago](https://wordpress.org/support/topic/stale-in-request-cache-after-wp_cache_flush/)
 * Hi SiteGround Optimizer team,
 * I’m a WordPress plugin developer ([neo-wp.com](https://neo-wp.com?ref=wporg-forum))
   and found an issue in the Memcached object-cache drop-in generated by SiteGround
   Optimizer 7.8.0: `wp_cache_flush()` does not fully invalidate cached data, causing
   stale WordPress metadata to be returned within the same request.
 * File: `templates/memcached.tpl`
    - Line 47: `wp_cache_flush()` delegates to `$wp_object_cache->flush()`.
    - Line 223: `WP_Object_Cache::flush()` flushes the Memcached instances but does
      not clear the local `$this->cache` array.
    - Line 239: `WP_Object_Cache::get()` preferentially returns values from that
      local array.
 * Consequently, `wp_cache_flush()` can continue returning stale values during the
   same request.
 * This causes failures after direct database updates: WordPress reads stale metadata,
   attempts to write the already-correct database value, and `update_post_meta()`
   returns `false` because zero rows were changed.
 * Please clear the local cache inside `flush()` as well, so `wp_cache_flush()` 
   fully invalidates cached values.
 * Best regards,
   Paul Schwind
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fstale-in-request-cache-after-wp_cache_flush%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Ivaylo Stoyanov](https://wordpress.org/support/users/ivaylostoyanov/)
 * (@ivaylostoyanov)
 * [1 week, 3 days ago](https://wordpress.org/support/topic/stale-in-request-cache-after-wp_cache_flush/#post-18977325)
 * Hello [@palsch](https://wordpress.org/support/users/palsch/),
 * Thank you for your feedback and observations.
 * I have reported this behaviour to our WordPress developers and will update this
   topic once we have more information.
 * In the meantime, your patience is greatly appreciated.
 * Best regards,
 * Ivaylo Stoyanov
 *  Plugin Support [Ivaylo Stoyanov](https://wordpress.org/support/users/ivaylostoyanov/)
 * (@ivaylostoyanov)
 * [1 week, 2 days ago](https://wordpress.org/support/topic/stale-in-request-cache-after-wp_cache_flush/#post-18978256)
 * Hello [@palsch](https://wordpress.org/support/users/palsch/),
 * Once again, we would like to thank you for your feedback.
 * Our WordPress developers have reviewed the reported behaviour and they have been
   able to replicate it.
 * While we cannot provide you with an ETA, I would like to assure you that this
   issue will be addressed in the future releases of our Speed Optimizer plugin.
 * Best regards,
 * Ivaylo Stoyanov

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fstale-in-request-cache-after-wp_cache_flush%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)

 * 2 replies
 * 2 participants
 * Last reply from: [Ivaylo Stoyanov](https://wordpress.org/support/users/ivaylostoyanov/)
 * Last activity: [1 week, 2 days ago](https://wordpress.org/support/topic/stale-in-request-cache-after-wp_cache_flush/#post-18978256)
 * Status: not resolved