Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#55455 closed defect (bug) (duplicate)

clean_site_details_cache() doesn't clean all site caches

Reported by: dd32 Owned by:
Priority: low Milestone:
Component: Networks and Sites Version: 4.7
Severity: minor Keywords:
Cc: Focuses: multisite

Description

clean_site_details_cache() clear's two caches:

	wp_cache_delete( $site_id, 'site-details' );
	wp_cache_delete( $site_id, 'blog-details' );

https://github.com/WordPress/wordpress-develop/blob/0b800e21c311e302824e4a025946a6fdb4f6c794/src/wp-includes/ms-blogs.php#L322-L337

But there's a third used within get_blog_details() that's closely related to those two caches:

	if ( $get_all ) {
		$details = wp_cache_get( $blog_id . 'short', 'blog-details' );
	} else {
		$details = wp_cache_get( $blog_id, 'blog-details' );

One could argue that the blog-details caches are not related to the site-details caches, but one would expect that if it clears some of them, that it'll clear all of them.

clean_blog_cache() is a much more comprehensive function though:

	wp_cache_delete( $blog_id, 'sites' );
	wp_cache_delete( $blog_id, 'site-details' );
	wp_cache_delete( $blog_id, 'blog-details' );
	wp_cache_delete( $blog_id . 'short', 'blog-details' );
	wp_cache_delete( $domain_path_key, 'blog-lookup' );
	wp_cache_delete( $domain_path_key, 'blog-id-cache' );
	wp_cache_delete( $blog_id, 'blog_meta' );

Change History (1)

#1 @sabernhardt
4 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Duplicate of #55454.

Note: See TracTickets for help on using tickets.