Search Engine Optimization > Web Design > IE caching images
IE caching images
Posted by Wojtek Bok on March 22nd, 2006

I am writing a site which allows the user to upload images.

The image is uploaded, then the app server creates a thumbnail of the
image. The thumbnail is then sent back to the user.

The user also has the option of rotating the image (if it was taken as
portrait, then image needs to be rotated).

The file names on the server side are generated and are unique, however
for a given image, the rotated and thunmbnail image names do not change
if the image is rotated.

When the user chooses to rotate the image, the app server deletes the
old thumbnail, rotates the image, then re-creates the thumbnail (with
the same name as the old thumbnail).

/image/image1.jpg
/image/image1R.jpg
/image/image1T.jpg

In Mozilla, the new thumbnail (rotated) is shown.

In IE, the old thumbnail is shown. I believe that IE checks the file
name, and seeing that it is the same, uses the cached image, even though
the file date/time have changed. If I force a reload on the page (SHIFT
Refresh), then I get the new image.

I have applied every HTTP header setting possible to defeat all caching,
including the trick to place a <head> section after the <body> section.

So how do I get IE to actually respect the directives not to cache?

As an added bonus, can I selectively cache one image and not another?

Funbolt.com - Entertainment portal, wallpapers, sexy celebs