[wp-trac] [WordPress Trac] #42252: Use more granular caching for common queries in `WP_Site_Query`

WordPress Trac noreply at wordpress.org
Sat Oct 21 22:46:42 UTC 2017


#42252: Use more granular caching for common queries in `WP_Site_Query`
------------------------------------------+------------------------------
 Reporter:  flixos90                      |       Owner:
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting Review
Component:  Networks and Sites            |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  multisite
------------------------------------------+------------------------------

Comment (by spacedmonkey):

 In [https://core.trac.wordpress.org/attachment/ticket/42252/42252.2.diff
 42252.2.diff] I went a completely different direction with this.

 So looking at the type of queries that WP_Site_Query is used for, these
 can be broken into 2, queries for a list of sites or query for a single
 site by domain / path / network_id. In my patch, it detects if query is
 for one site and uses different caching rules. If you are looking for a
 single site, then generate a cache key based on a domain/path/network_id.
 The cache lives forever, until it is invalidated in `clean_blog_cache`.
 This cache will have some massive improvements to profile of WordPress,
 but cahce invalidation will be the trick here.

 I think if my patch in some form goes into core, it will have to go with
 #42284 to see the benefits.

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


More information about the wp-trac mailing list