[wp-trac] [WordPress Trac] #57150: Implement wp_cache_get_multi() in wp_queue_posts_for_term_meta_lazyload()

WordPress Trac noreply at wordpress.org
Fri Nov 18 17:19:15 UTC 2022


#57150: Implement wp_cache_get_multi() in wp_queue_posts_for_term_meta_lazyload()
-------------------------+--------------------
 Reporter:  ocean90      |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  6.2
Component:  Taxonomy     |    Version:
 Severity:  normal       |   Keywords:
  Focuses:  performance  |
-------------------------+--------------------
 This is a follow-up to #36953 and #50352.

 Quoting @boonebgorges:

 > `WP_Query` calls `wp_queue_posts_for_term_meta_lazyload()`, which in
 turn grabs the `{$taxonomy}_relationships` cache for each found post, for
 each taxonomy that they belong to. So if you're fetching 20 items, and
 each item is in 10 taxonomies, the process will require 200 cache gets.
 This is in addition to the dozens of other other cache priming gets that
 happens in `WP_Query`.
 >
 > On very high traffic sites running an object cache backend, the high
 volume calls to the cache can cause performance issues.

 This is something I have recently noticed for a site. Attaching a
 screenshot of the trace details of a single request. This is the result
 for the main query with 15 posts and each post can have one or more terms
 in six taxonomies.

 This seems to be a place where core should also make use of
 `wp_cache_get_multi()` so that cache implementations like the
 [https://github.com/rhubarbgroup/redis-cache Redis Object Cache] can
 combine the requests into a single request.

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


More information about the wp-trac mailing list