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

WordPress Trac noreply at wordpress.org
Sat Nov 21 22:43:56 UTC 2015


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

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


Comment:

 > ...it doesn't seem to cache per blog ID.

 It adds the cache to the default "bucket" which is keyed by blog ID. The
 same happens in the persistent cache as far as I know.

 This function is actually (a bit) safer than `_wp_upload_dir_baseurl()` as
 the filter is run every time on the pre-cached data.

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


More information about the wp-trac mailing list