[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
Tue May 27 00:37:43 UTC 2025
#59592: Store last changed value in key instead of using it as a salt for query
caches
--------------------------------------+-----------------------------
Reporter: spacedmonkey | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Cache API | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+-----------------------------
Comment (by peterwilsoncc):
@spacedmonkey I'm happy if last changed needs to be passed to the
functions given your and Till's comments.
As to naming, I think naming things is very hard. I can see a few
[https://wpdirectory.net/search/01JW7HYEE2KAR8KKFBBX80323D plugins using
the last changed pattern] for cache invalidation so I think ''my''
original suggestion of using the keyword `query` isn't great. Note: there
are a few false positives in the link provided.
Canonically, I think we'd want the naming convention to be with the cache
API (ie, `wp_cache_` prefixed) rather than `wp_query` prefixed as we'll
eventually be using this elsewhere.
Maybe it's as simple as `wp_cache_last_changed_set|get|etc` but others
will have opinions, I am sure.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59592#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list