Make WordPress Core


Ignore:
Timestamp:
04/07/2022 05:57:59 PM (2 years ago)
Author:
spacedmonkey
Message:

Networks and Sites: Improve cache key generation in WP_Network_Query class.

Improve cache key generation in the WP_Network_Query class by removing update_network_cache element in the array used to generate the cache key. This
element does not affect that cache and by removing it, it improves the likelihood of reusing an existing cache.

Props Spacedmonkey, furi3r, johnbillion, johnjamesjacoby, flixos90.
Fixes #55461.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-network-query.php

    r52977 r53098  
    243243        $_args = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) );
    244244
    245         // Ignore the $fields argument as the queried result will be the same regardless.
    246         unset( $_args['fields'] );
     245        // Ignore the $fields, $update_network_cache arguments as the queried result will be the same regardless.
     246        unset( $_args['fields'], $_args['update_network_cache'] );
    247247
    248248        $key          = md5( serialize( $_args ) );
Note: See TracChangeset for help on using the changeset viewer.