我在IE上通过https使用etags缓存内容时遇到问题。
Chrome和Firefox允许我使用
的组合成功缓存内容If-Modified-Since
和
If-None-Match
If-None-Match标头很重要,因为可以用两种不同的方式查看同一页面,这将产生不同的etags。
这非常有效,除非我使用IE浏览器(我已经尝试过IE9和10)而不是https。在这种情况下,它会删除if-none-match标头,但不会删除if-modified-since标头。这是一个问题,因为现在它为两种不同的查看方式显示相同的缓存内容,因为修改后的时间戳和网址都匹配。
SSL证书有效,我读过这可能会导致问题,并且它可以在FF和Chrome中使用。有办法解决这个问题吗?
以下是Chrome,IE(http)和IE(https)中的标题 请注意,IE(https)中缺少If-None-Match标头。 我已经包含请求和响应,以防问题与服务器响应有关。 我更改了网址和服务器名称。
Chrome - https (按预期工作)
GET /events/1618 HTTP/1.1
Host: test.co.uk
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36
Referer: http://test.co.uk/events/1618
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: auth_token=2397dd7dc6ce88ab66fc8efc4150f60232f977f3; _auction_session=BAh7CUkiD3Nlc3Npb25faWQGOgZFVEkiJTY4ZjdiMTQxYmEzMjJiZjUwNjc1MmQ2M2FjZTM5MDI wBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMTlkS3JKLzRLbE5Sd1V1Q2QxUkFlUWI0bjhwMFo1RlRqMDkwMDR4SnNESUE9BjsARkkiDHVzZXJfaWQGOwBGaQJgBUkiD2luX3NhbmRwaXQGOwBGSSIJdHJ1ZQY7AFQ%3D--c54fabd39a2678f2cdee6f76d9812dda331dbf61; locale=en-uk
If-None-Match: "327fd750ae149bd0589dc13bea9c48f2"
If-Modified-Since: Fri, 21 Mar 2014 08:35:50 GMT
HTTP/1.1 304 Not Modified
Date: Fri, 21 Mar 2014 14:05:03 GMT
Server: Apache/2.2.3 (CentOS)
Connection: close
ETag: "ba4788d17893e6ff2593af9e360db7cc"
Cache-Control: must-revalidate, private, max-age=0
Set-Cookie: locale=en-uk; path=/; expires=Sat, 21-Mar-2015 14:05:03 GMT
IE - http (按预期工作)
Request GET /events/1618 HTTP/1.1
Accept text/html, application/xhtml+xml, */*
Referer http://test.co.uk/events/1618
Accept-Language en-GB
User-Agent Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)
Accept-Encoding gzip, deflate
Host test.co.uk
If-Modified-Since Fri, 21 Mar 2014 08:35:50 GMT
If-None-Match "327fd750ae149bd0589dc13bea9c48f2"
DNT 1
Connection Keep-Alive
Cookie locale=en-uk; auth_token=2397dd7dc6ce88ab66fc8efc4150f60232f977f3; _auction_session=BAh7CkkiD3Nlc3Npb25faWQGOgZFVEkiJTIxMzRhMTQwYzZhNjU4ZTE2NGY5Y2Y4ZGNjZjVhN2I 3BjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMXFReklPK3oxNEZSUUEwa3AyeFZLY3REVkJCMDI4U3UwVnlYNlJnSFZGakE9BjsARkkiDHVzZXJfaWQGOwBGaQJgBUkiD2luX3NhbmRwaXQGOwBGSSIJdHJ1ZQY7AFRJIhdpbl9zYW5kcGl0X2FzX3VzZXIGOwBGSSIJMTM0MQY7AFQ%3D--91e307c63096e1cc96f265d457480707021b25dc
Response HTTP/1.1 304 Not Modified
ETag "327fd750ae149bd0589dc13bea9c48f2"
X-Request-Id 16ab60d75b2bedcad96a182423771e63
X-Runtime 0.983268
X-Rack-Cache miss
X-Powered-By Phusion Passenger 4.0.37
Content-Length 21788
Status 200 OK
Content-Type text/html; charset=utf-8
Expires Fri, 21 Mar 2014 13:06:23 GMT
Last-Modified Fri, 21 Mar 2014 08:35:50 GMT
IE - https (未按预期工作)
Request GET /events/1618 HTTP/1.1
Accept text/html, application/xhtml+xml, */*
Accept-Language en-GB
User-Agent Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)
Accept-Encoding gzip, deflate
Host test.co.uk
If-Modified-Since Fri, 21 Mar 2014 08:35:50 GMT; length=26501
DNT 1
Connection Keep-Alive
Cookie locale=en-uk; auth_token=2397dd7dc6ce88ab66fc8efc4150f60232f977f3; _auction_session=BAh7CkkiD3Nlc3Npb25faWQGOgZFVEkiJTIxMzRhMTQwYzZhNjU4ZTE2NGY5Y2Y4ZGNjZjVhN2I3BjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMXFReklPK3oxNEZSUUEwa3AyeFZLY3REVkJCMDI4U3UwVnlYNlJnSFZGakE9BjsARkkiDHVzZXJfaWQGOwBGaQJgBUkiD2luX3NhbmRwaXQGOwBGSSIJdHJ1ZQY7AFRJIhdpbl9zYW5kcGl0X2FzX3VzZXIGOwBGSSIJMTM0MQY7AFQ%3D--91e307c63096e1cc96f265d457480707021b25dc
Response HTTP/1.1 304 Not Modified
ETag "327fd750ae149bd0589dc13bea9c48f2"
X-Request-Id 25aab65eb6028c521622e86d8d716226
X-Runtime 0.406167
X-Rack-Cache miss
X-Powered-By Phusion Passenger 4.0.37
Content-Length 26501
Status 200 OK
Content-Type text/html; charset=utf-8
Expires Fri, 21 Mar 2014 13:14:02 GMT
Last-Modified Fri, 21 Mar 2014 08:35:50 GMT
我非常感谢任何建议。