Possible performance issues caused by the media browser?

We have a MODX site that shows performance issues in the frontend when someone uses the media browser in the backend. Some folders contain around 500 images and the previews are created on thy fly. I suppose this can cause much server load. Can this preview generation be the cause of the frontend speed? Is there a way to fix that or handle this better?

Maybe changing the system setting modx_browser_default_viewmode to list helps.

That solves the thumbnail generation. Thanks!

But loading the image list of 427 images still takes 14,72 seconds. Maybe because the image size is calculated during loading the list. Can this be reduced too?

I couldn’t find anything in the code to skip the image size calculation.
Maybe you are more successful:

Maybe it can be cached somehow.

If the function @getimagesize is the issue, then I think it runs 3 times for every image:

So this could at least be optimized.

If i disable the dimension calculation and thumbnail generation in buildManagerImagePreview, the load goes from 15 to 3 seconds. But the image dimensions are still in the list for whatever reason.

Another way of looking at this problem in general: In your hosting configuration, if you’re able to run manager and connector requests on a separate PHP process pool, that can help isolate crunchy manager activity and reduce its effect on front end performance.