Changes between Initial Version and Version 1 of Ticket #21270, comment 12
- Timestamp:
- 07/31/2012 09:17:49 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #21270, comment 12
initial v1 1 1 nacin beat me to it. My comment: 2 2 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.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(). 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. 4 4 5 5 These 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.