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

WordPress Trac noreply at wordpress.org
Fri Feb 5 20:05:49 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 markoheijnen):

 Replying to [comment:37 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)

 Plugins I have seen only using the base and upload it into their own
 directory.

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


More information about the wp-trac mailing list