WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #21270, comment 12


Ignore:
Timestamp:
07/31/12 21:17:49 (21 months ago)
Author:
ryan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21270, comment 12

    initial v1  
    11nacin beat me to it. My comment: 
    22 
    3 Actually, this can cause quite a few extra queries when running without a persistent cache. switch_to_blog() calls wp_cache_init() which obliterates the wp cache instance. With a persistent cache this simply means some extra cache trips to repopulate the local cache after calling restore_current_blog(). nacin and I discussed a softer init that maintains a stack of pointers to existing cache objects. 
     3Actually, this can cause quite a few extra queries when running without a persistent cache. switch_to_blog() calls wp_cache_init() which obliterates the wp cache instance. With a persistent cache this simply means some extra cache trips to repopulate the local cache after calling restore_current_blog(). Without persistence this means db queries to repopulate local cache. nacin and I discussed a softer init that maintains a stack of pointers to existing cache objects. 
    44 
    55These functions should be deprecated and switch_to_blog()/get_option()/restore_to_blog() should be used instead. This way multiple option calls can be done within one switch_to_blog() instead of switching and restoring for every *_blog_option() call.