Subject: [PATCH] Add expiration to dirsize_cache transient so that it is not autoloaded
---
Index: wp-includes/functions.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
--- a/wp-includes/functions.php	(revision bb35fa4233cadd69f3ec9cf075e4dcd29d363b8e)
+++ b/wp-includes/functions.php	(date 1688741152050)
@@ -8318,7 +8318,7 @@
 
 	// Only write the transient on the top level call and not on recursive calls.
 	if ( $save_cache ) {
-		set_transient( 'dirsize_cache', $directory_cache );
+		set_transient( 'dirsize_cache', $directory_cache, MONTH_IN_SECONDS );
 	}
 
 	return $size;
@@ -8358,7 +8358,7 @@
 		strpos( $path, '\\' ) === false
 	) {
 		unset( $directory_cache[ $path ] );
-		set_transient( 'dirsize_cache', $directory_cache );
+		set_transient( 'dirsize_cache', $directory_cache, MONTH_IN_SECONDS );
 		return;
 	}
 
@@ -8377,7 +8377,7 @@
 		unset( $directory_cache[ $path ] );
 	}
 
-	set_transient( 'dirsize_cache', $directory_cache );
+	set_transient( 'dirsize_cache', $directory_cache, MONTH_IN_SECONDS );
 }
 
 /**
