Mike Gorman
Mike Gorman

Reputation: 11

How to prevent IE6 from refetching already-fetched images added via DOM manipulation

If you add a image to your browser's DOM, IE6 will not check its cache to see if it already downloaded the image but will, instead, re-retrieve it from the server. I have not found any combination of HTTP response headers (of the ensuing image request) to convince IE6 that it can cache the image: Cache-control, Expires, Last-modified.

Some suggest you can return a 304 of the subsequent image requests to tell IE6 "you already got it" but I want to avoid the whole round trip to the server in the first place.

Upvotes: 1

Views: 701

Answers (2)

Ionuț Staicu
Ionuț Staicu

Reputation: 22194

Maybe this will work? (is the same behaviour like hovering on links with css background image)

Upvotes: 1

dwilkins
dwilkins

Reputation: 2141

A quick google mentions the "Expires" header, which you've already tried. Digging deeper, it mentions the ETag header:

http://mir.aculo.us/2005/08/28/internet-explorer-and-ajax-image-caching-woes

Hope this helps.

Upvotes: 0

Related Questions