Samuel
2004-10-17 15:23:53 UTC
Is there anyway to get IE to cache a redirected image? For example, I have
a 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
a 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