mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Query: Improve WP_Query's cache key generation for taxonomy queries.
Modify how `WP_Query` determines whether a database query contains a taxonomy component and accounts for term changes when generating the cache key. This presents a stale cache been used under some circumstances. Props Chouby, costdev, peterwilsoncc. See #22176. git-svn-id: https://develop.svn.wordpress.org/trunk@54111 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3094,7 +3094,7 @@ class WP_Query {
|
||||
$key = md5( serialize( $cache_args ) . $new_request );
|
||||
|
||||
$last_changed = wp_cache_get_last_changed( 'posts' );
|
||||
if ( ! empty( $this->tax_query->queried_terms ) ) {
|
||||
if ( ! empty( $this->tax_query->queries ) ) {
|
||||
$last_changed .= wp_cache_get_last_changed( 'terms' );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user