Make WordPress Core


Ignore:
Timestamp:
08/29/2019 12:41:45 PM (5 years ago)
Author:
flixos90
Message:

Multisite: Improve performance by caching not found lookups for sites and networks.

With this change, the result of a site or network lookup by ID will be cached even if the ID does not exist. When a new site or network is created, the cache for the respective new ID is cleared.

Props mnelson4, nielsdeblaauw.
Fixes #42251.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/schema.php

    r45805 r45910  
    11601160    }
    11611161
     1162    if ( function_exists( 'clean_network_cache' ) ) {
     1163        clean_network_cache( $network_id );
     1164    } else {
     1165        wp_cache_delete( $network_id, 'networks' );
     1166    }
     1167
    11621168    wp_cache_delete( 'networks_have_paths', 'site-options' );
    11631169
Note: See TracChangeset for help on using the changeset viewer.