[wp-trac] [WordPress Trac] #34359: Cache output of `wp_upload_dir()` to improve performance
WordPress Trac
noreply at wordpress.org
Wed Jan 13 01:19:05 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:25 mikeschroder]:
Was thinking more about avoiding the `wp_mkdir_p()` call on (very) busy
sites with persistent cache. That seems to be the slowest part of
`wp_upload_dir()` and is needed only once a month when uploading a file.
We have to keep calling it so we are 100% backwards compatible. If a theme
uses `wp_upload_dir()` on the front end on a busy site, it is called many
thousands of times every day for no good reason :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34359#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list