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

WordPress Trac noreply at wordpress.org
Thu Feb 4 02:36:02 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 mikeschroder):

 Replying to [comment:34 azaozz]:
 > Thinking more about this: doing `$create_dir = is_user_logged_in()` is a
 nice optimization especially for sites without persistent cache. It's
 worth adding it.
 >
 > Can't think of any cases where a not-logged-in user will need to
 check/create the uploads sub-dirs.

 So, I think this is a good idea.  One thought, though: Would
 contact/support forms be affected by that, for things like attaching
 documents? (also perhaps anonymous image/video uploads, although probably
 less frequently)

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


More information about the wp-trac mailing list