[wp-trac] [WordPress Trac] #40228: Use get_sites in get_blog_details

WordPress Trac noreply at wordpress.org
Mon Oct 16 22:05:34 UTC 2017


#40228: Use get_sites in get_blog_details
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  flixos90
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  4.9
Component:  Networks and Sites                   |     Version:
 Severity:  blocker                              |  Resolution:
 Keywords:  has-patch has-unit-tests dev-        |     Focuses:  multisite
  feedback ms-roadmap                            |
-------------------------------------------------+-------------------------

Comment (by flixos90):

 We discussed this in detail in today's meeting and came to the conclusion
 that the commit should be reverted for now:

 * The original idea was to bring back the `blog-lookup` cache, since it's
 less aggressively invalidated (per site instead of per ''any'' site). We
 wanted to leverage it in `get_site_by()` first, however it caches full
 site objects including their site details which is not what's needed in
 `get_site_by()`. So we then considered bringing it back to
 `get_blog_details()` itself.
 * However, there's also the `blog-details` cache, which is in a way more
 stable than either of the `sites` or `site-details` cache since it also
 caches sites not found (as -1).

 The above with all the other complexity of `get_blog_details()` involved
 brought us to the conclusion to revert this change for now.

 In addition, `get_site_by()` itself should be reverted as well for now and
 rescheduled for 5.0: We need to generally work on improving caching for
 `WP_Site_Query` (and `WP_Network_Query`) as well as consider storing not
 found values for the `sites` and `networks` caches too. While
 `get_site_by()` makes sense as an explicit and less complex replacement
 for `get_blog_details()`, it is not ready yet in terms of caching, where
 it currently falls short of `get_blog_details()` under specific
 circumstances. When we have the new code's caches work as well as the old
 ones, we can introduce `get_site_by()` as a proper replacement for
 `get_blog_details()` and reconsider using it in the old function too.

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


More information about the wp-trac mailing list