We have a Laravel application and imagine the following: We have a slider with a play button that will start showing images on a slideshow. These images arrived from web cameras so obviously there are a lot of images. The load time of the page is horrible because it is trying to load ALL the images and often, even PHP runs out of memory trying to load all the images. Now, I can increase the amount of memory and execution time for PHP to keep doing it, but isn't there a more sophisticated way to load these images depending on where do I scroll the slider or press the play button?
Also, one thing to keep in mind: Showing the images are behind an auth system so, not anyone is allowed to watch any camera. It depends on the rules and the users settings, etc...