This is a discussion on Why IE refuse to cache redirected image? within the PHP Language forums, part of the PHP Programming Forums category; Is there anyway to get IE to cache a redirected image? For example, I have an page with the following: &...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Is there anyway to get IE to cache a redirected image? For example, I have
an page with the following: <html><body> <img src=http://site1.com/redir.php?id=12> </body></html> The image is redirected to a different location through a script. If I don't redirect and just point to the final image, IE caches the image properly. Why is Internet Explorer not caching my image? Mozilla and Opera works correctly. See the headers below (today's date is Oct 5). +++GET 1+++ GET /redir.php?id=12 HTTP/1.1 Accept: */* Referer: http://site1.com/ Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322) Host: site1.com Connection: keep-alive +++RESP 1+++ HTTP/1.1 302 Found Date: Tue, 05 Oct 2004 18:06:46 GMT Server: Apache Accept-Ranges: bytes Location: http://site2.com/real.php?id=12 Content-Encoding: gzip Cache-Control: max-age=86400 Expires: Wed, 06 Oct 2004 18:06:46 GMT Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 +++GET 2+++ GET /real.php?id=12 HTTP/1.1 Accept: */* Referer: http://site1.com/ Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322) Host: site2.com Connection: keep-alive +++RESP 2+++ HTTP/1.1 200 OK Date: Tue, 05 Oct 2004 18:10:35 GMT Server: Apache Accept-Ranges: bytes Cache-Control: max-age=604800, s-maxage=604800 Expires: Tue, 12 Oct 2004 18:10:35 GMT Content-Length: 3234 Connection: close Content-Type: image/jpeg |
|
|||
|
Samuel wrote:
> Is there anyway to get IE to cache a redirected image? For example, I have > an page with the following: > Browsers shouldn't cache negotiated content. What they should do if an 'expires' header is sent....? Solution would be to full the browser into thinking it's not negotiated content by embedding the parameters in the path and using mod_rewrite or a custom 404 handler to convert back to the real php script + parameters. HTH C. |