[wp-trac] [WordPress Trac] #21434: Don't obliterate the object cache in switch_to_blog()

WordPress Trac wp-trac at lists.automattic.com
Thu Oct 4 13:42:47 UTC 2012


#21434: Don't obliterate the object cache in switch_to_blog()
-------------------------+-----------------------
 Reporter:  ryan         |       Owner:  ryan
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  3.5
Component:  Cache        |     Version:  3.4.1
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+-----------------------

Comment (by ryan):

 flush() is not the proper replacement. It does nothing with some backends,
 especially for multisite.

 We don't want to encourage flushing/resetting the cache, we want to
 encourage switch_to_blog(). For unit tests that use the default backend,
 consider overwriting the cache object. wp_cache_flush() is fine, though,
 when testing a specific backend that is known to support flushing for both
 single and multisite.

 I'll add a note to the phpdoc. Patch coming up.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21434#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list