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

WordPress Trac noreply at wordpress.org
Thu Dec 7 08:35:54 UTC 2017


#42252: Use more granular caching for common queries in `WP_Site_Query`
--------------------------------------+------------------------
 Reporter:  flixos90                  |       Owner:  flixos90
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  5.0
Component:  Networks and Sites        |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+------------------------
Changes (by flixos90):

 * keywords:  needs-unit-tests has-patch => has-patch has-unit-tests


Comment:

 [attachment:42252.8.diff] adds tests for the different caches.

 It essentially adds only one test, however it uses systematically
 generated datasets for it, so that all cases of domain/path/network ID
 combinations are covered, making it sufficient for the change. In
 addition, each set is tested with both a random site field updated and
 then again with a field updated that is used as `orderby` in the query, to
 ensure those fields cause a change accordingly.

 You will notice that some existing tests have been modified. However this
 is only to account for the three new sites that have been added in
 `wpSetUpBeforeClass()` and are used for the new test.

 Missing are tests that ensure that when one of the special fields is
 changed on a site, the caches for both the new and old value are cleared.
 However those would currently fail anyway since WordPress doesn't have
 logic for this in place. #40364 implements that logic, therefore I suggest
 we merge that one first (when it's ready), and then proceed with this one
 here.

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


More information about the wp-trac mailing list