In my opinion, it is not a good thing to use PHP to upload images.
If you do so, you will be causing PHP to have to process all the contents of an image and then send a response to the browser.
This can be expensive for the server in terms of processing, since PHP needs to use memory to render this image.
Not to mention that the browser has a specific mechanism for image caches. Perhaps by doing it for PHP, you cannot enjoy this functionality, since it is actually a PHP script that will be processed, and not an image.
The solution I usually use for cases where I need to use PHP to process images is: Process the image once, giving it the desired format, and save it. I usually convert them all to the same format.
I believe that if you want to improve the performance of your images, you can invest some time in creating a Thumbs system. Using resized images or with proper treatment, you can achieve desired performance. But I don’t think that always loading with a PHP script is appropriate. Now, if you do this once, creating a static image optimizes, I think that would be a good solution.
90% of content is image, but the user sees all that content at a time? A good way to save both server and client resources would be to use the loading strategy of the images.
– Thomas
At home I have a banner that occupies 90% of the resolution of the user, followed by a list with approximately 30 images, when the user der scroll plus 10 lists of these are created, and when it arrives at the end another 10 will be created again.
– Leo Letto
When user gives scroll it loads 300 images?
– Thomas
Currently are loaded approximately 100 initial images and each list we have the same images organized differently, but yes in the near future will be something like this 300/400 images in total
– Leo Letto
Depending on your layout Lazy loading would still be good. See http://ressio.github.io/lazy-load-xt/demo/infinite.htm
– Thomas