[wp-trac] [WordPress Trac] #40180: Introduce `get_site_by()` function for multisite

WordPress Trac noreply at wordpress.org
Mon Oct 16 22:12:52 UTC 2017


#40180: Introduce `get_site_by()` function for multisite
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  jeremyfelt
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  4.9
Component:  Networks and Sites                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback has-unit-     |     Focuses:  multisite
  tests ms-roadmap needs-dev-note                |
-------------------------------------------------+-------------------------
Changes (by flixos90):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Due to issues that came up in
 https://core.trac.wordpress.org/ticket/40228#comment:32, we revisited the
 way caching in `get_site_by()` currently works.

 We discussed the topic in detail today and came to the conclusion that
 `get_site_by()` should be reverted for now and rescheduled for 5.0: We
 need to generally work on improving caching for WP_Site_Query (and
 WP_Network_Query) to use special caches for common use-cases, which can be
 invalidated less aggressively (currently any change to any site/network
 invalidates every site/network query cache). We should furthermore
 consider storing not found values for the `sites` and `networks` caches
 too.

 To be clear: `get_site_by()` itself still ''is'' probably ready, but
 `WP_Site_Query` that it uses needs to improve how it caches results for
 the function to be really beneficial.

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


More information about the wp-trac mailing list