WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/29/2019 12:41:45 PM (3 weeks 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-includes/ms-site.php

    r45236 r45910  
    7070    }
    7171
     72    clean_blog_cache( $wpdb->insert_id );
     73
    7274    $new_site = get_site( $wpdb->insert_id );
    7375
     
    7577        return new WP_Error( 'get_site_error', __( 'Could not retrieve site data.' ) );
    7678    }
    77 
    78     clean_blog_cache( $new_site );
    7979
    8080    /**
Note: See TracChangeset for help on using the changeset viewer.