Microsoft KB Archive/319546

= PRB: Internet Explorer Cache Is Not Used When You Run innerHTML Code to Insert the Same Image Multiple Times =

Article ID: 319546

Article Last Modified on 10/13/2003

-

APPLIES TO


 * Microsoft Internet Explorer (Programming) 6.0
 * Microsoft Internet Explorer 5.5

-



This article was previously published under Q319546



SYMPTOMS
When you run Internet Explorer, the Internet Explorer cache is not used as you expect when you run innerHTML code to insert the same image multiple times. Notice the following code samples: myDiv1.innerHTML = &quot;&quot; myDiv2.innerHTML = &quot;&quot; The preceding code results in sending two GET requests to retrieve the Image.gif file in Internet Explorer 6.0. Three GET requests are sent to retrieve the Image.gif file in Internet Explorer 5.5. Your expectation is that the Web server would be hit only one time.



RESOLUTION
To work around this problem, use one or both of the following methods:   Preload the image in a DIV element with the display:none attribute:   Create a brief time-delay so that Internet Explorer has enough time to verify whether the image is in the cache, and then call the innerHTML property.



STATUS
This behavior is by design.

Additional query words: extra request

Keywords: kbprb KB319546

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.