Re: Getting IE6 to honor caching directives and CACHE contents...



Daniel Smedegaard Buus wrote:
Hey hey :)

My application is feeding some images through PHP. I try to set headers to make sure that the browser caches the images for 10 minutes. This works fine except in, hold your breath, Internet Explorer.

For some reason, it keeps re-requesting the images, resulting in mouse-over image swaps "flickering" and, of course, unnecessary load on the web server.

These are the headers I set which works for all browsers I've tried except IE:

// We need to set a public cache control and put a "last modified" header,
// otherwise we don't receive the "if modified since" header on subsequent
// re-requests:
header('Cache-Control: public, max-age=600');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Expires: 600');
header('Content-Type: '.$mime_type);

I tried adding [ header('Age: 1'); ] and changing the expires header to [ header('Expires: '.gmdate('D, d M Y H:i:s', time()+600).' GMT'); ], this doesn't work either, and AFAICT this syntax is wrong anyway if you ask w3.org.

Finding info on this on Google is a bit difficult, because as we all probably know, the most common problem is not to get IE to CACHE content but to get it to NOT cache content, which is the opposite of my problem ;)

Anybody got any ideas?

TIA,
Daniel :)


Wrong place. This is an IE problem, so try an IE newsgroup.

But you'll find cache headers and other browser directives are only recommendations. There is no way to force the browser to follow them.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: Content-Type application/pdf wird u.U. nicht interpretiert
    ... PDF-Code im Browser angezeigt. ... Leider tritt keine Änderung ein (den Cache hatte ich vorher geleert). ... Ich bin versucht anzunehmen, daß du beim Setzen dieses Headers etwas ...
    (microsoft.public.de.german.inetexplorer.ie6)
  • Re: Force Browser to Cache Images under SSL?
    ... It is not possible for a server to force the browser to do anything. ... the server can only refrain from marking the images as non-cacheable. ... Whether the browser chooses to cache is TOTALLY up to the browser. ...
    (microsoft.public.inetserver.iis.security)
  • Re: FAQ Topic - Why are my Rollovers so slow?
    ... Images are cached by the browser depending on the headers ... If the server does not send sufficient ... To overcome this you must send suitable headers. ...
    (comp.lang.javascript)
  • Re: Asu no Yoichi - feeble new harem comedy anime
    ... Probably because the bad redirects were already cached in your browser - ... you usually need to flush the cache before the images ...
    (rec.arts.anime.misc)
  • Re: [PHP] Re: how to retrieve pictures from postgreSQL DB
    ... but what do you mean by "adding some cache related headers"? ... "DO NOT CACHE THIS PAGE, ... Just search for "cache control headers" and you'll find out more. ... The above prevents you having to supply any data as the browser is just ...
    (php.general)