[wp-trac] [WordPress Trac] #22661: Allow object caches to degrade gracefully

WordPress Trac noreply at wordpress.org
Thu Feb 15 18:07:53 UTC 2018


#22661: Allow object caches to degrade gracefully
---------------------------------------+-----------------------------
 Reporter:  markjaquith                |       Owner:
     Type:  defect (bug)               |      Status:  reopened
 Priority:  normal                     |   Milestone:  Future Release
Component:  Cache API                  |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  2nd-opinion needs-testing  |     Focuses:
---------------------------------------+-----------------------------
Changes (by markjaquith):

 * keywords:  2nd-opinion => 2nd-opinion needs-testing


Comment:

 Replying to [comment:22 jtsternberg]:
 > I’m still seeing issues with this approach, but only on multisite.

 I conferred with @jtsternberg a bit on this, and yeah, that "else if"
 block gets triggered on subsequent runs of the function (which happens in
 multisite), which causes it to think an external cache is being used when
 it is not.

 We worked on a refactor, and came up with [attachment:22661-logic-
 refactor.diff], which converts `$first_init` to a `static`, which enables
 us to tell if it is a first run of the function (during which we should
 try to load `object-cache.php` or detect that `advanced-cache.php` has
 already loaded it) or a secondary run of the function (during which we
 should do neither).

 @jtsternberg tested with Batcache, multisite, and with an `object-
 cache.php` that does not define `wp_cache_init()` (our "fall back to
 normal in-memory caching" scenario).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/22661#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list