I am working on a page that builds a content dynamically thru client-side
scripting. At one of my client sites, their internet access is through a
proxy server, which causes caching to happen at the proxy rather than the
client. Adding images dynamically is painfully slow under this scenario.
For images loaded thru javascript, it seems that IE will go back to the
proxy to download each instance of each image. For example, if you add the
same image to the document 20 times, you can watch IE download that image 20
items in the task bar.

However, for any images that are present when the page initially loads, IE
will optimize and only download each image once. So my question is this: is
there a way to get IE to use the images it already has in memory when adding
images dynamically? I know about the pre-loading images technique using new
Image(), but that does not help this problem.

Sample code to add the same image to a document 20 times:

<script language="javascript">
var m_imgPreloaded = new Image(16, 16);
m_imgPreloaded.src = "/Images/Test.gif";

function addImages()
{
var imgNew = null;
for (i = 0; i < 99; i++)
{
imgNew = document.createElement("IMG");
imgNew.height = 16;
imgNew.width = 16;
imgNew.src = m_imgPreloaded.src;
document.body.insertBefore(imgNew);
imgNew = null;
}
}
</script>

--
Michael Shutt

Please respond to newsgroup as I will not return direct emails.




--
Michael Shutt

Please respond to newsgroup as I will not return direct emails.