I need to show in a PHP web page all the images in a folder. A pagination is required. The images can be more than 10,000, so a good performance is important, and here is where my doubt comes from, what is more efficient?
Paginate the images of the folder using
scandir.Automatically save the name of all images in a database and load them with a
Mysqliquery (probably also convenient to use a temporary cache).Any other suggestions you can give me.
The website uses WordPress as the engine, but the images are uploaded to a subdomain using a PHP file isolated from Wordpress ...
I thought about saving the name of all the images like a WordPress Custom-Post-Type (using mysqli basic queries) and paginate them like any other publication, but I think that, due to the amount, it would harm the overall performance of the website (because the custom-post-type are saved in the same table as the other publications)...
The website receives more than 30 thousand daily visits that it must support.
PD: Sorry for the bad explanation but it is complicated to explain, and more in another language.