[wp-trac] [WordPress Trac] #54221: _transient_dirsize_cache is set to autoload=yes and kills db performance if it grows (20MB in our case)

WordPress Trac noreply at wordpress.org
Mon Sep 4 12:08:17 UTC 2023


#54221: _transient_dirsize_cache is set to autoload=yes and kills db performance if
it grows (20MB in our case)
-------------------------------------+-------------------------------------
 Reporter:  archon810                |       Owner:  spacedmonkey
     Type:  defect (bug)             |      Status:  assigned
 Priority:  normal                   |   Milestone:  6.4
Component:  Database                 |     Version:  2.8
 Severity:  major                    |  Resolution:
 Keywords:  has-patch changes-       |     Focuses:  administration,
  requested                          |  performance
-------------------------------------+-------------------------------------

Comment (by spacedmonkey):

 Replying to [comment:42 flixos90]:
 > * Why do we set the expiration to `0` (none) when `wp_installing()`?

 It may not be needed but it was designed follow these
 [https://github.com/WordPress/wordpress-
 develop/blob/fa9f8397bc29c6ace079bdafb610f6b988b61948/src/wp-
 includes/option.php#L1192-L1194 lines]. It feels a little edge case, so
 may not be needed.

 > The $expiration variable definition in the clean_dirsize_cache()
 function should be moved below the early return if clause.

 I agree with this feedback @nicomollet .

 Question, do we need to clean the transient / update the autoload value on
 upgrade? Say in `wp_upgrade`?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54221#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list