[wp-trac] [WordPress Trac] #59516: Improve cache key generation in query classes

WordPress Trac noreply at wordpress.org
Fri Jan 17 15:32:55 UTC 2025


#59516: Improve cache key generation in query classes
-----------------------------------------------+--------------------------
 Reporter:  spacedmonkey                       |       Owner:  pbearne
     Type:  defect (bug)                       |      Status:  accepted
 Priority:  normal                             |   Milestone:  6.8
Component:  Query                              |     Version:
 Severity:  normal                             |  Resolution:
 Keywords:  has-patch changes-requested early  |     Focuses:  performance
-----------------------------------------------+--------------------------

Comment (by spacedmonkey):

 In my mind, the things I was looking for to improve the cache key
 generation here.

 - Sorting of array keys.
 - Removing of null values that would not effect query.
 - Values of array that can be a string with a comma or an array, all to be
 an array.
 - Values that can be int or string, all to be one type, ie string.
 - Sorting of values that are arrays, where it would not effect the query.
 Example, post types in WP_Query, but not posts__in, as this value can be
 used to order the query.

 Not sure if we should break this up input one ticket per query. The logic
 would be the same. We might even want some shared util functions for this.

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


More information about the wp-trac mailing list