css background doesn't cache image

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a page where I use the same image as the css background url for a
number of elements (<li>'s and <a>'s). Rather than getting the image the
first time, caching it and redisplaying it, IE insists on retrieving the
image from the web server for each element where it is the background. Since
there are a large number of these on the page, this eats up signicant
bandwidth (number of elements x size of the image). I've tried absolute
paths and relative paths to the css background image, but it doesn't seem to
matter.

So far, my only solution is to explicitly include an <img> tag each place I
want it and use javascript to preload the image. This works but at the
expense of a very bloated page (though not as bad as loading the image
multiple times). Does anyone know how to get IE to recognize and cache the
image?
 
Hi Virtual,
Try preloading the images. You will have to hunt around for the java code
snippet for this, macro-media use it it their web pages.

An after-thought is to replace your included stylesheet with a styling tag
in your page header. This seems the more logical solution to me as the image
urls will be grouped with the page's other resouces and will be cached with
the page. (me thinks?)

Hope that works!

Regards.
 
Back
Top