How can I force the web browser to cache my images?
Created May 4, 2012
Salman Khan In JavaScript, do
var image1 = new Image(); image1.src = "xyz.gif";And then use image1.src wherever you were using the xyz.gif
This will cache the image.
See also http://www.jguru.com/faq/view.jsp?EID=377
[Note: there seems to be a bug in IE 5.5 preventing this from working. See the forum thread for details. -A]