[wp-trac] [WordPress Trac] #40228: Use get_sites in get_blog_details
WordPress Trac
noreply at wordpress.org
Tue Oct 10 21:46:02 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: normal | Resolution:
Keywords: has-patch has-unit-tests dev- | Focuses: multisite
feedback ms-roadmap |
-------------------------------------------------+-------------------------
Comment (by flixos90):
Replying to [comment:30 westi]:
> The issue is that by switching to `WP_Site_Query` and using get_sites()
as our source of caching to avoid queries we effectively remove most of
the caching behind `get_blog_details`.
>
> Previously the cached data for a blog would only been invalidated if
there were changes to that blogs details or they were explicitly cleared.
>
> Now we have caching into `WP_Site_Query` which is invalidated everytime
we change the `last_changed` value for `sites`.
Do I understand you correctly that you are talking particularly about the
removal of the `blog-lookup` cache (used for domain/path combination
lookups before)? We faced a similar issue before with #40362, and your
comment confirms our approach to hold off of that one.
Given the outlined problems, my suggestion would be to add usage of that
cache group back in cases where it applies (domain+path), and do something
similar to a lookup by ID (the individual `sites` cache is also more
granularly invalidated than `last_changed` used by `WP_Site_Query`). So
we'd keep using `get_sites()` in case of a cache miss for the original
caches.
Does that sound good to you?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40228#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list