mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Multisite: More specific caching for get_dirsize.
Instead of one cache entry for all upload folders for a site on multisite, this now caches for each folder and invalidates that cache based on context. In multisite, this should speed up `get_dirsize` calls since older directories that are much less likely to change will no longer have the size recalculated. Props janthiel, A5hleyRich, batmoo. Fixes #19879. git-svn-id: https://develop.svn.wordpress.org/trunk@49212 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -5914,7 +5914,7 @@ function wp_delete_attachment( $post_id, $force_delete = false ) {
|
||||
$file = get_attached_file( $post_id );
|
||||
|
||||
if ( is_multisite() ) {
|
||||
delete_transient( 'dirsize_cache' );
|
||||
invalidate_dirsize_cache( $file );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user