I have a game which upon loading downloads many files. After I am trying to use them in the webpage they are being downloaded once more, I guess it has something to do with the memory capacity for the webpage but I am having hard time verifying this assumption. What should I do to have files saved in client memory until he closes the webpage? Here you can see how the same file was downloaded twice. First time I use this code to get images from server before playing:
function doAjaxImg(param, lambda) {
let image = new Image();
image.onload = () => lambda();
image.src = param;
}
Then I simply change image.src for the image I want to show on the screen and it requests from the server this image again.