[wp-trac] [WordPress Trac] #34359: Cache output of `wp_upload_dir()` to improve performance

WordPress Trac noreply at wordpress.org
Sat Nov 7 00:46:59 UTC 2015


#34359: Cache output of `wp_upload_dir()` to improve performance
-------------------------------------------------+-------------------------
 Reporter:  DH-Shredder                          |       Owner:  DH-
     Type:  defect (bug)                         |  Shredder
 Priority:  normal                               |      Status:  assigned
Component:  Media                                |   Milestone:  4.4
 Severity:  normal                               |     Version:
 Keywords:  has-patch needs-testing needs-unit-  |  Resolution:
  tests                                          |     Focuses:  multisite,
                                                 |  performance
-------------------------------------------------+-------------------------
Changes (by azaozz):

 * keywords:  needs-patch => has-patch needs-testing needs-unit-tests


Comment:

 In 34359.patch:
 - Cache the `$uploads` array before filtering.
 - Test different upload paths (and create upload sub-directories) only
 once after filtering.
 - If an error occurs when creating new upload sub-directory, cache the
 error separately and add it to the returned data.

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


More information about the wp-trac mailing list