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

WordPress Trac noreply at wordpress.org
Mon Oct 16 18:31:14 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 spacedmonkey):

 [https://core.trac.wordpress.org/attachment/ticket/40228/40228.improved-
 caching.2.diff 40228.improved-caching.2.diff]

 Addes some improves to the `get_site_by` function.

 - If the lookup is by id, don't use `get_sites`, just use `get_site` and
 do the network_id compare  using the `WP_Site` object for better
 performance.
 - Implement the `blog-lookup` cache in `get_site_by` to save lookup on
 domain + path, as this cache key is invalidated in `clean_blog_cache` and
 `get_sites` is invalidated a lot in high traffic sites.

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


More information about the wp-trac mailing list