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

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 2 18:31:15 UTC 2012


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

 * owner:   => ryan
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [21403]:
 {{{
 #!CommitTicketReference repository="" revision="21403"
 Introduce wp_cache_switch_to_blog() and WP_Object_Cache::switch_to_blog()
 as a lighter/faster way to switch the cache to a new blog id.

 Add the blog id to the cache keys for multisite installs.

 Use wp_cache_switch_to_blog() instead of wp_cache_init() in
 switch_to_blog().

 Use wp_cache_switch_to_blog() instead of wp_cache_reset() in
 wp_start_object_cache().

 Deprecate wp_cache_reset().

 This avoids the many queries needed to re-prime the cache after
 switch_to_blog() on multisite installs using the default cache backend.

 fixes #21434
 }}}

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


More information about the wp-trac mailing list