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

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 31 23:53:43 UTC 2012


#21434: Don't obliterate the object cache in switch_to_blog()
-------------------------+-------------------
 Reporter:  ryan         |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  3.5
Component:  Cache        |    Version:  3.4.1
 Severity:  normal       |   Keywords:
-------------------------+-------------------
 switch_to_blog() calls wp_cache_init() which destroys the current
 $wp_object_cache object and creates a new one. This can be really
 expensive, especially with the non-persistent default cache. Instead of
 reinitializing, let's introduce something like wp_cache_switch_to_blog().
 The memcached backend already builds the blog id into keys not in global
 groups, making ::switch_to_blog() very easy to implement. The default
 cache can do the same (I think it was keyed by blog id once upon a time).

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


More information about the wp-trac mailing list