Browser Image Caching In IE Does Not Work In Update Panel

  • Thread starter Thread starter Rain
  • Start date Start date
R

Rain

When the content of the panel is refreshed. The image is reloaded event
though the browser has it in its cache. Does anyone know how to prevent this
happening ?

<asp:updatepanel id="xxx" runat"=server" >
<contenttemplate>

<img src="myImage.gif" alt="" />


</content ..........
 
when the panel is updated, all the html inside the panel div is re-rendered.,
so the browser re-fetches the image and displays it. use fiddler to check the
cache headers to see why the cache is not used.

-- bruce (sqlwork.com)
 
Hi Bruce.

Ive never heard of fiddler, I assume its a HTTP Sniffer for which I have
IEWebDeveloper . I have discovered two things since I wrote this.

1.) This is not a problem in IE7. only IE6

2.) using the following code seems to create a cached version in the
document. so that the only time the images are loaded is on the first GET.

myImage = new Image();
myImage.src = "imageURL";

Now I still need to check this in IE6. But if you preload this in the
window.load event, it never has to go back to the server in IE7. I think it
still might be an issue in IE6 but Ill find out tomorrow, if so Ill have to
find another strategy.


Cheers for the help.
 
Back
Top