Opened 3 years ago
Closed 9 months ago
#15361 closed defect (bug) (duplicate)
wp_start_object_cache() should be called within blog switching methods instead of wp_cache_init()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Cache | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | mpretty@…, simon@…, willmot |
Description
The switch_to_blog() and restore_current_blog() functions call wp_cache_init() directly, which causes the object cache instance to be recreated. These methods should instead be calling the wp_start_object_cache() method which correctly checks whether wp_cache_init() or wp_cache_reset() should be used.
Attachments (1)
Change History (15)
prettyboymp — 3 years ago
comment:3
prettyboymp — 3 years ago
- Cc mpretty@… added
- Resolution set to fixed
- Status changed from new to closed
- Summary changed from w_start_object_cache() should be called within blog switching methods instead of wp_cache_init() to wp_start_object_cache() should be called within blog switching methods instead of wp_cache_init()
We don't really need to re-add global and non-persistent groups or do those file and function exists checks. Maybe switch_to_blog() should directly call wp_cache_reset() if it exists otherwise do wp_cache_init().
Suggesting we revert the changeset, for this reason:
comment:11
ryan — 2 years ago
- Milestone changed from 3.1 to Future Release
comment:12
simonwheatley — 2 years ago
- Cc simon@… added
comment:13
willmot — 2 years ago
- Cc willmot added
comment:14
nacin — 9 months ago
- Milestone Future Release deleted
- Resolution set to duplicate
- Status changed from reopened to closed
I think this is mostly handled now by #21434.
Note: See
TracTickets for help on using
tickets.

Related: #14992