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

WordPress Trac noreply at wordpress.org
Tue Oct 17 17:29:10 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              |   Keywords:  needs-patch needs-unit-tests
  Focuses:  multisite           |
--------------------------------+------------------------------------------
 The new function `get_site_by()` that should serve as a modern replacement
 for `get_blog_details()` ended up not making it into 4.9, because it had
 several drawbacks of the latter related to caching, particularly caused by
 the caches used in `WP_Site_Query` being invalidated on any update to any
 site, which makes caching almost useless in a very big and active setup.

 Better handling of caching specific queries that are common should be
 explored, particularly for queries which can be invalidated only by
 invalidating the caches for a specific site instead of relying on the
 aggressively invalidated `last_changed`. Let's look at how some of the old
 caches like `blog-lookup` or `blog-id-cache` work, and apply that to the
 modern behavior of `WP_Site_Query`.

 While mentioning `get_site_by()` above, the changes should preferably be
 made to `WP_Site_Query` to benefit any other multisite area making such
 queries as well.

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


More information about the wp-trac mailing list