• 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 calling wp_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 to wp_upload_dir() not be cached as a W3_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 of wp_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

    https://www.ads-software.com/plugins/w3-total-cache/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter flynsarmy

    (@flynsarmy)

    This issue is pretty big – in this page hit W3_Plugin_Cdn::link_replace_callback took a whopping 2.8s to complete with 59 calls – about half of which is due to wp_upload_dir() alone: https://i.imgur.com/jvHWC2H.png

    Thread Starter flynsarmy

    (@flynsarmy)

    It’s disappointing that this issue is being completely ignored. It’s a relatively big one and an easy one to fix.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Better wp_upload_dir management’ is closed to new replies.