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

WordPress Trac noreply at wordpress.org
Wed Feb 10 05:10:36 UTC 2016


#34359: Cache output of `wp_upload_dir()` to improve performance
-------------------------------------------+-------------------------------
 Reporter:  mikeschroder                   |       Owner:  mikeschroder
     Type:  defect (bug)                   |      Status:  assigned
 Priority:  normal                         |   Milestone:  4.5
Component:  Media                          |     Version:
 Severity:  normal                         |  Resolution:
 Keywords:  needs-testing has-patch early  |     Focuses:  multisite,
                                           |  performance
-------------------------------------------+-------------------------------

Comment (by azaozz):

 Replying to [comment:43 joemcgill]:
 > I wonder if anyone is filtering the site URL upstream from
 `wp_uploads()` based on some context (e.g. is_admin(), etc.)

 It's not "impossible", but it is the wrong way to do it. That would mean
 either using the pre_option_* filter or updating the option (writing to
 the DB) every time. The "right way" is to use the `upload_dir` filter.

 > This may be another case for not using a persistent cache.

 Right, this part is not in persistent cache.

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


More information about the wp-trac mailing list