IE reloads images on every page hit

  • Thread starter Thread starter Paul Baranowski
  • Start date Start date
P

Paul Baranowski

Hi Everyone -

I am developing a web application that uses images for navigation
purposes. The problem is that with IE6, the images are re-fetched
every time the user clicks on something. Mozilla handles this
correctly and does not reload the images and thus the page comes up
almost instantaneously. IE 6 (and possibly other versions - I havent
tested them) does not use the cached images - resulting in each page
being loaded very slowly. I have verified that IE is actually
fetching the images, by looking at the apache access log file. I have
tried setting the "Expires" HTTP header for the images like thus:

<Directory /var/www/html/goodnewsnewsletter/admin/images>
ExpiresActive On
ExpiresDefault "access plus 24 hours"
</Directory>

I have verified that the Expires header is being transferred correctly
by looking at the "Page Info" screen in mozilla when I load the page.
The images have an expiry of one day.

I have created a demo login to the application so that you can view
this behaviour for yourself if you like:

http://goodnewsnewsletter.com/admin.php
u: demo
p: demo

This site is our testing site, so there is no problem if you play
around with it. Any suggestions would be greatly appreciated.

- Paul Baranowski
(e-mail address removed)
 
http://goodnewsnewsletter.com/admin.php

The images are not being cached. To see this try to load an individual
image offline. Use the Privacy Report to get a full URL since the
source just uses relative addresses.

http://goodnewsnewsletter.com/admin/images/clouds1.jpg

I think the problem might be this header which is being sent
with some of your .jpg and .gif files

Vary: *


< http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44 >

(Google web search for
vary http rfc
)


I have seen caching problems with other values of that header before
which I assumed then were the cause of the file not being cached
but maybe IE doesn't like that header at all? Do you have any
way to test without sending that header?


Hmm... here's another oddity from your server:

Cache-Control: max-age=86400, max-age=86400

Why is that parameter being repeated? That looks like a bit of a fuzzy
area anyway. Could you eliminate that directive completely too?


BTW it didn't make any difference if I changed my protocol
settings from HTTP 1/1 to HTTP 1/0. Your server still sent
the same things.


HTH

Robert Aldwinckle
 
Thanks Robert, I finally found the answer to my question:

If you right click on an image in IE and go to "Properties", you will
see that the image size is unknown.

The problem was that I had mod_gzip enabled on the web server, and it
was trying to compress images. I *DID* have the following line in my
httpd.conf file in the mod_gzip section:

# NO: images (GIF etc., will rarely ever save anything)
mod_gzip_item_exclude mime ^image/

However, this seems to be ignored. Adding these lines above it solved
the problem:

mod_gzip_item_exclude file \.gif$
mod_gzip_item_exclude file \.jpg$
mod_gzip_item_exclude file \.jpeg$


Paul Baranowski
(e-mail address removed)
 

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

Back
Top