How to prefetch and prerender an entire file of images

I have a bunch of images stored in

The images are all pretty similar like image1.png, image2.png, etc. So the URL is

Is there a way to prefetch/prerender all images in the file for a page?


The following PHP file automatically shows all the images in your folder, and you don’t have to manually update anything, just upload to the folder.

$folder = 'images/page1/';
$filetype = '*.*';
$files = 

$count = count($files);
echo '<table>';
for ($i = 0; $i < $count; 

$i++) {
echo '<tr><td>';
echo '<a name="'.$i.'" 

<img src="'.$files[$i].'" 

substr($files[$i],strlen($folder), strpos($files[$i], '.')-strlen($folder));
echo '</td></tr>';
echo '</table>';

HTML5 supports resource pre-fetching which utilizes browser idle time to download or prefetch documents that the user might visit in the near future.

Solution A: You can load the page where all these images are shown:

<link rel="prefetch prerender" href="page1.html">

Solution B: You can cache the images individually:

<link rel="prefetch prerender" href="/images/big.jpeg">
<link rel="prefetch prerender" href="/images/big2.jpeg">
<link rel="prefetch prerender" href="/images/big3.jpeg">

Note: prerender is not a standard attribute but yet is supported by Chrome & IE11+

Learn more here

Need Your Help

PDO Union Count

php mysql pdo

public function totalRecords($keyword) {

Get current cell from =choose functions

excel vba excel-vba

I have a cell with a choose function