humanmade / S3-Uploads

The WordPress Plugin to Store Uploads on Amazon S3
1.94k stars 389 forks source link

Medialibrary slower to load #620

Open robbertrosario opened 1 year ago

robbertrosario commented 1 year ago

Loading images at the front-facing part of our website is going smoothly however ever since offloading the images, we've noticed that the WP Media Library takes about ~25 / ~30 seconds to load the 80 thumbnails and the same for every page thereafter.

Has anyone else faced this problem? is there anything you can do this about this?

rmccue commented 1 year ago

The media library will be reading your images from S3 rather than the local filesystem so you should expect this to be slower. The pagination in place should take care of this for the most part, so you shouldn't be seeing 30s load times though, so I'd suggest debugging your performance using a tool like XDebug.

joehoyle commented 1 year ago

The media library shouldn't have to read the files at all from s3 or the filesystem. It's possible a plugin (or lack of attachment metadata around sizes) is however trying to read directly from images files. I've seen that many times before. Though it's bad practice to do that (and afaik Core does not do that anywhere), it's not unusable to see people continue to do that, as the performance impact when using local disk is a lot less than external, such as s3.

robbertrosario commented 1 year ago

Thanks for both your responses, i've turned every other plugin off but still see around a ~24 / ~25s delay, where admin-ajax is blocking things before the images get loaded. It's a testing environment and it has basic auth, not sure if that somehow impacts the loading time.