Better wp_upload_dir management
-
We’re using AWS Cloudfront origin pull CDN and with New Relic I noticed the
W3_Plugin_Cdn::_replace_folder_placeholders
method is firing around 120 times, each iteration callingwp_upload_dir()
which is quite a slow function call.New Relic shows
wp_upload_dir()
was called 123 times, eating up 355ms. Could the first call towp_upload_dir()
not be cached as aW3_Plugin_Cdn
class property so as only to be called once per page load? The only check you’d need to ensure is that for WP Multisite you keep one copy ofwp_upload_dir()
s results per blog in the class property.Here’s a screenshot of what I’m talking about: https://i.imgur.com/UskWr8t.png
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Better wp_upload_dir management’ is closed to new replies.