[wp-trac] [WordPress Trac] #55352: Improve cache key generation in WP_Term_Query

WordPress Trac noreply at wordpress.org
Sun Mar 27 22:02:33 UTC 2022

#55352: Improve cache key generation in WP_Term_Query
 Reporter:  spacedmonkey              |       Owner:  spacedmonkey
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  6.0
Component:  Taxonomy                  |     Version:  4.7
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance

Comment (by peterwilsoncc):

 Replying to [comment:10 johnjamesjacoby]:
 > I’d like to kindly suggest, rather than inlining everything in existing
 methods, that a new method be used to reshape these arguments for improved
 cache key usage.

 What benefit does this provide?

 Most of the changes were to normalize the DB query as it's sanitized.
 While nessesary for the cache key, this also improves hits to the DB
 servers query cache.

 Normalizing the WP cache is about three lines of code.

Ticket URL: <https://core.trac.wordpress.org/ticket/55352#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list