SITUATION:
My page has about 500 <img>
elements that are dynamically generated and populated with image urls from an API request that refreshes the data once per hour.
PROBLEM:
Every few page loads, a good amount of images fail to load the image with error code 0().
WHAT I TRIED:
I also tried putting all the images directly in one of my website's folders and loading them from there and the same behaviour happens.
Some times all images load without any issue, sometimes a good number of them fail to load.
QUESTION:
How can I make sure the images always load ?
P.S.: I checked the image urls when the images fail to load, the urls are correct.
EDIT:
To be clear, my question has most likely nothing to do with the requests themselves since the image urls are properly loaded inside the <img>
tags, it's the images that fail to load, not the urls.