Following up on two earlier posts regarding the similar issues on Drupal - intolerable performance and changing the KCFinder folder. In our case we are running WordPress 5.1.1, CiviCRM 5.10.3, so it is clear that this issue is neither Drupal related nor has it been sufficiently addressed since the earlier posts. In our case, our VPS sits behind a cloud proxy and the delays cause a timeout due to stalling, sending a warning message that simply scares people trying to use CiviMail who have no idea what's going on under the hood (see the photo below that pops up when this happens from Sucuri who provides the cloud proxy)
Any chance that KCFinder could parse out the images into folders that are date-dependent? For example the WordPress Media Library stores all the uploads into monthly folders, aka images/yyyy/mm. Also the WordPress Media Library seems to have much snappier search and load capabilities of thumbnails to choose from. For us, and presumably other Wordpress-Civi sites, we would prefer that CiviMail just integrate directly with the WordPress Media Library, not only because it seems much more robust, snappier and searchable, but it puts all our media for our work in just ONE place (staff was uploading images BOTH into WordPress and into CiviCRM, wasting resources).
In the meantime, this workaround suffices: open up 2 browser tabs, one on the WordPress Media Library (WPM) and one on CiviMail, the mailer that is being edited. In order to insert an image into the mailer: (1) simply focus on WPM, grab the URL from an existing image or upload a new image and grab it's URL; (2) switch focus to CiviMail and insert the image into the mailer pasting the URL into Source and ignore the KCFinder icon altogether.
Although the workaround works, it is a bit geeky and for someone who just wants to simply upload or select an existing uploaded image without either a long wait or a firewall connection timeout thru our cloud proxy (no other functions in Civi or WordPress do that), it would be better if KCFinder either stored the data for efficient browsing or allowed a hook into the host CMS Media Library (WordPress, Joomla, or Drupal ... if there is one).