Make WordPress Core


Ignore:
Timestamp:
03/10/2023 04:27:23 PM (2 years ago)
Author:
spacedmonkey
Message:

Cache API: Introduce new queries cache groups.

Give developers more control over how query caches are handled within an object caches. Now all caches that cache the result of a query, are cached in a group that is suffixed with -queries. Developers can use these groups, to add custom cache invalidation rules or to make them none persistent.

Props spacedmonkey, owi, tillkruess, skithund, peterwilsoncc, flixos90, sergeybiryukov, mukesh27.
Fixes #57625.

File:
1 edited

Legend:

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

    r54637 r55526  
    251251
    252252        $cache_key   = "get_network_ids:$key:$last_changed";
    253         $cache_value = wp_cache_get( $cache_key, 'networks' );
     253        $cache_value = wp_cache_get( $cache_key, 'network-queries' );
    254254
    255255        if ( false === $cache_value ) {
     
    263263                'found_networks' => $this->found_networks,
    264264            );
    265             wp_cache_add( $cache_key, $cache_value, 'networks' );
     265            wp_cache_add( $cache_key, $cache_value, 'network-queries' );
    266266        } else {
    267267            $network_ids          = $cache_value['network_ids'];
Note: See TracChangeset for help on using the changeset viewer.