[wp-trac] [WordPress Trac] #59594: Remove $taxonomies from cache key generation in WP_Term_Query

WordPress Trac noreply at wordpress.org
Wed Oct 11 11:39:34 UTC 2023


#59594: Remove $taxonomies from cache key generation in WP_Term_Query
--------------------------+----------------------------
 Reporter:  spacedmonkey  |      Owner:  (none)
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Future Release
Component:  Taxonomy      |    Version:
 Severity:  normal        |   Keywords:  good-first-bug
  Focuses:  performance   |
--------------------------+----------------------------
 When generating cache keys in generate_cache_key method in WP_Term_Query,
 a serialized version of $taxonomies is used. This is not needed as the
 array of taxonomies are stored in the arguments used to generate the
 $cache_args variable. This part of the cache key can safely be removed.

 Before

 {{{#!php
         $taxonomies = (array) $args['taxonomy'];
         $key        = md5( serialize( $cache_args ) . serialize(
 $taxonomies ) . $sql );
 }}}


 After

 {{{#!php
         $key = md5( serialize( $cache_args ) . $sql );
 }}}

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


More information about the wp-trac mailing list