mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 15:47:38 +02: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. Built from https://develop.svn.wordpress.org/trunk@54111 git-svn-id: http://core.svn.wordpress.org/trunk@53670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b8f713ab09
commit
31c90342c9
@ -3094,7 +3094,7 @@ class WP_Query {
|
|||||||
$key = md5( serialize( $cache_args ) . $new_request );
|
$key = md5( serialize( $cache_args ) . $new_request );
|
||||||
|
|
||||||
$last_changed = wp_cache_get_last_changed( 'posts' );
|
$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' );
|
$last_changed .= wp_cache_get_last_changed( 'terms' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.1-alpha-54110';
|
$wp_version = '6.1-alpha-54111';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user