[wp-trac] [WordPress Trac] #57625: WP_Query cache memory leak
WordPress Trac
noreply at wordpress.org
Tue Feb 7 20:11:00 UTC 2023
#57625: WP_Query cache memory leak
--------------------------+------------------------------
Reporter: owi | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cache API | Version:
Severity: normal | Resolution:
Keywords: | Focuses: performance
--------------------------+------------------------------
Comment (by spacedmonkey):
How about changing the cache group that query are stored in?
{{{#!php
$cached_results = wp_cache_get( $cache_key, 'posts', false, $cache_found
);
}}}
Becomes
{{{#!php
$cached_results = wp_cache_get( $cache_key, 'post-query', false,
$cache_found );
}}}
Then we could do this
{{{#!php
function clean_post_cache( $post ) {
...
if( wp_cache_supports( 'flush_group' ) ) {
wp_cache_flush_group( 'post-query' );
}
}}}
If we can this change, it should be allowed to all query caches, so,
`WP_Comment_Query`, `WP_Term_Query`, `WP_Site_Query` and
`WP_Network_Query`, caches found in `get_pages` and `get_page_by_path`.
There are other query caches that been in core for years, so is this such
a problem now?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57625#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list