Update: I would like to point out Samantha's response. It provides a more efficient solution. However, I will keep my original post for historical purposes (unless it is recommended to remove both the content and my reply? I am still learning).
An alternative approach that was commonly used in the past involves creating a landing page designed to preload all necessary images before redirecting to the main site. To implement this method, you must gather the URLs of all images to be loaded and follow these steps:
# within index.html, our preloader
<script type='text/javascript'>
// store all image paths in an array
var images = [
'/images/image1.png',
'/images/image2.png',
'/images/image3.png'
];
for(var i in images) {
var img = images[i];
var element = document.createElement('img');
// setting the source triggers image loading and caching by the browser
element.src = img;
}
// after all images are preloaded, redirect to the intended page
window.location = '/home.html';
</script>
<body>
<h1>Loading....</h1>
<img src="loading.gif"/>
</body>