Click to See Complete Forum and Search --> : make ie to use cached images


pti4ka
12-01-2004, 08:30 AM
i have a few dynamic javascript effects on my page involving moving of images,and show/hide effects.
the problem is that every time something changes,like image appears or moves or some elements are redrawn, ie every time tries to download affected images again...
i'm absolutly sure that that's what happening because i see in ie's status bar messages like "downloading pic1.png...".
for example i have some simple slide show from two images.
first image(pic1.png) appears, secong image(pic2.png) disappears and that repeats itself again. the moment each image appears i see in status bar message "downloading pic1.png..." or "downloading pic2.png" and if this slideshow runs every 100msec then each and every time ie tries to download image...

i tried to include this header:
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT');
but it seems it has no effect...(i copied it from comments on php.net)

would appreciate any help on this
thank you

scragar
12-01-2004, 08:38 AM
just a small comment but why not just tell the user to get a normal browser like moz (www.mozila.org) or opera? this would certainly sovle your problem...

that headwer tag doesn not refer to the images, but rather the page, this means that although the page is cached this has no effect on you images.

pti4ka
12-01-2004, 08:45 AM
scragar:) i agree with you that ie really sucks...
in firefox these effects work just fine.

anyway i have to try to make it to work for ie also

that headwer tag doesn not refer to the images, but rather the page, this means that although the page is cached this has no effect on you images.

yes,i understand that but i had to try it anyway...it is better than not trying anything...

i think i need to do some cache control in this case but i don't know exactly what headers to use and where to apply it
(this is really STUPID for ie to check image every time it needs to be redrawn)

scragar
12-01-2004, 09:21 AM
if your URL has a query part then see if you can do without it(using sessions or cookies if nessesary).

just a small idea but see if you can send the header from the images

pti4ka
12-01-2004, 09:34 AM
just a small idea but see if you can send the header from the images

theoreticly i can send each image with own header by using intermidiate php file and i'm going to try this
i'm just curious if i'm the first one who encounters these kind of problem in ie...

maybe there is possibility of handle this without treating eahc image individually

also,i found this note on php.net in commnets:
http://www.php.net/manual/en/function.header.php
the note written by ondrew at quick dot cz

do you think this can help in my case?

scragar
12-01-2004, 09:41 AM
yes, it proberly would.

pti4ka
12-01-2004, 10:33 AM
now i know a little bit more...
first of all none of the two ideas work:
i attached "expires" header before sending image
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT');
and this has no effect...
and the idea on one of the comments on php.net doesn't work at all...

now i went in another direction...
i'm testing my page at home with local apache server... so i looked into logs and there i see response 304 as it should be...so basicly on server side everything was alright(i don't need to send control cache headers)

so what is really happening is that ie no matter what always tries to download the image despite 304 answer...this is the most stupid thing i ever see...:confused:

i'm really don't know how to solve this...
:confused: