[wp-trac] [WordPress Trac] #59592: Store last changed value in key instead of using it as a salt for query caches
WordPress Trac
noreply at wordpress.org
Wed May 28 07:58:44 UTC 2025
#59592: Store last changed value in key instead of using it as a salt for query
caches
--------------------------------------+---------------------------
Reporter: spacedmonkey | Owner: spacedmonkey
Type: enhancement | Status: assigned
Priority: normal | Milestone: 6.9
Component: Cache API | Version: 6.1
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+---------------------------
Changes (by spacedmonkey):
* owner: (none) => spacedmonkey
* status: new => assigned
* version: => 6.1
* milestone: Future Release => 6.9
Comment:
After feedback from @peterwilsoncc @tillkruess @sanchothefat @flixos90 I
have rewritten the PR at https://github.com/WordPress/wordpress-
develop/pull/8728.
This new PR adds the following functions.
wp_cache_get_query_data( $cache_key, $group, $last_changed )
wp_cache_set_query_data( $cache_key, $data, $group, $last_changed )
wp_cache_set_multiple_query_data( $cache_keys, $data, $group,
$last_changed )
wp_cache_get_multiple_query_data( $cache_keys, $group, $last_changed )
The updated PR, does not have unit tests and docs yet. It just a sense
check on the approach, I will get the PR into a final stage to merge.
I am happy with the new functions, it makes it easier to update the code
and add these style caches to your own code.
I have also moved this ticket into the milestone, as it looks like it is
going ahead.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59592#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list