[wp-trac] [WordPress Trac] #34359: Cache output of `wp_upload_dir()` to improve performance
WordPress Trac
noreply at wordpress.org
Wed Feb 10 04:02:45 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 joemcgill):
Replying to [comment:42 mikeschroder]:
> However, have this failing unit test:
I believe this may a flaw in our unit tests for #15928 and #32112.
Essentially, we're changing the scheme of the 'site_url' during the course
of the tests in order to check the URL created by
`wp_get_attachment_image()` in different contexts. However, caching the
uploads directory is effectively negating those changes. We should
probably rewrite those tests so we filter the output of `wp_uploads()`
instead of changing the `site_url()` option during the same set of
operations.
However, I wonder if anyone is filtering the site URL upstream from
`wp_uploads()` based on some context (e.g. is_admin(), etc.), because that
will no longer take affect if we're caching the output of the uploads
directory. This may be another case for not using a persistent cache.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34359#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list