[wp-trac] [WordPress Trac] #35075: Comment cache ignores custom query vars
WordPress Trac
noreply at wordpress.org
Mon Dec 14 14:41:43 UTC 2015
#35075: Comment cache ignores custom query vars
-----------------------------+-----------------------------
Reporter: jason_the_adams | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: trunk
Severity: normal | Keywords:
Focuses: performance |
-----------------------------+-----------------------------
It's currently very possible to add custom query vars to the get_comments
function, for themes and plugins to extend. A problem occurs, however, if
the function is being used and a custom query var is being used, but no
standard ones are changing. This is because it caches the first query, and
every subsequent query is then assumed to be the same since custom query
vars are ignored.
I first thought about just using the entire query_vars array for caching,
but decided there's probably a reason this wasn't done. So instead I
decided it would make the most sense to make a filter for the cache keys
so a plugin/theme can add its own keys that should be considered for
caching.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35075>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list