Browser Image Caching In IE Does Not Work In Update Panel

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 ..........
 
B

bruce barker

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)
 
R

Rain

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top