[wp-trac] [WordPress Trac] #30430: WP_Object_Cache does not properly cache objects nested in arrays

WordPress Trac noreply at wordpress.org
Wed Dec 31 04:54:41 UTC 2014


#30430: WP_Object_Cache does not properly cache objects nested in arrays
-------------------------------------------------+-------------------------
 Reporter:  jamesgol                             |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Cache API                            |  Review
 Severity:  normal                               |     Version:  2.0
 Keywords:  reporter-feedback has-patch needs-   |  Resolution:
  testing needs-unit-tests                       |     Focuses:
-------------------------------------------------+-------------------------

Comment (by dd32):

 > Any suggestions on how to do that in the tests?

 I don't think it's really possible.

 One possibility would be to:
  - Require a object-cache.php dropin be loaded and configured (and skip
 the test if not loaded)
  - Run set();  Flush the PHP cache (by clearing the variable directly);
 and then running get(); - forcing the data to be retrieved from the
 external cache

 The problem with that, is that the variable that the object cache dropin
 uses will vary, in the case of Core and Memcache it's
 `$wp_object_cache->cache` but others might be different (or have it marked
 private)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30430#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list