[wp-trac] [WordPress Trac] #37189: In wp_term_query on cache ids

WordPress Trac noreply at wordpress.org
Thu Mar 3 11:07:34 UTC 2022


#37189: In wp_term_query on cache ids
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Taxonomy                             |     Version:  4.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing has-unit-    |     Focuses:
  tests                                          |  performance
-------------------------------------------------+-------------------------

Comment (by spacedmonkey):

 @boonebgorges Is there any chance you could take a look at my PR
 [https://github.com/WordPress/wordpress-develop/pull/2346 #2346]. It is
 very close to being mergeable.

 Working noting, in my testing, this PR does increase the number of SQL
 queries. The use of `_prime_term_caches`, means one query for getting the
 ids and another for get term data. This is likely to be a benefit in my
 cases. Get term data via `_prime_term_caches` and `get_term` means that
 any term loaded into cache on a request will not be reloaded again. This
 is an expected behaviour.

 The key goal of this ticket is not to store massive term objects in cache.
 There are limits to what can be stored in object caches. Not to mention,
 the fact if terms are updated, these caches may not be correctly
 invalidated.

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


More information about the wp-trac mailing list