[wp-trac] [WordPress Trac] #42280: Multisite: get_blogs_of_user has no useful caching on large installs
WordPress Trac
noreply at wordpress.org
Thu Oct 19 16:45:27 UTC 2017
#42280: Multisite: get_blogs_of_user has no useful caching on large installs
--------------------------------+-------------------------------------
Reporter: westi | Owner:
Type: defect (bug) | Status: new
Priority: high | Milestone: Awaiting Review
Component: Networks and Sites | Version: 4.7
Severity: major | Resolution:
Keywords: 2nd-opinion | Focuses: multisite, performance
--------------------------------+-------------------------------------
Changes (by flixos90):
* keywords: => 2nd-opinion
Comment:
@westi We are currently looking into improving caching in `WP_Site_Query`
so that it is less aggressively invalidated for certain queries. By making
changes to `WP_Site_Query`, we would ensure that all functions using
`get_sites()` would get these benefits. #42252 is the ticket where this is
being worked on, if you are interested in that.
I'm not opposed to adding special caches to certain functions that require
more unique lookups though. For the case of `get_blogs_of_user()`, it may
likely be the best option to make it work closer to what it was like
before:
* Upon having all the site IDs, call `_prime_site_caches()` for it in
order to not require countless DB queries.
* Then, for each site ID, call `get_site()` and build the array with it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42280#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list