Http 为什么在使用if-modified-since并且需要更新缓存的资源时会有两个请求?

Http 为什么在使用if-modified-since并且需要更新缓存的资源时会有两个请求?,http,Http,我在《顿悟》中有一个奇怪的行为,这在谷歌chrome上是不会发生的 请求如下: GET / HTTP/1.1 Host: 127.0.0.1:1026 Accept: text/html,... User-Agent: Mozilla/5.0 ... Accept-Encoding: gzip, deflate If-Modified-Since: Fri, 22 May 2015 08:58:02 GMT Accept-Language: en-us Connection: Keep-Aliv

我在《顿悟》中有一个奇怪的行为,这在谷歌chrome上是不会发生的

请求如下:

GET / HTTP/1.1
Host: 127.0.0.1:1026
Accept: text/html,...
User-Agent: Mozilla/5.0 ...
Accept-Encoding: gzip, deflate
If-Modified-Since: Fri, 22 May 2015 08:58:02 GMT
Accept-Language: en-us
Connection: Keep-Alive
以下是我的回应:

HTTP/1.1 200 OK
Date: Mon, 25 May 2015 07:11:43 GMT
Accept-Ranges: bytes
Last-Modified: Mon, 25 May 2015 07:11:09 GMT
Content-Type: text/html
Content-Length: 134

<!DOCTYPE html>
...
为什么在发送资源以响应第一个请求后,我会收到第二个请求?

这是一个错误。

看来Safari也有类似的问题

GET / HTTP/1.1
Host: 127.0.0.1:1026
Accept: text/html,...
User-Agent: Mozilla/5.0 ...
Accept-Encoding: gzip, deflate
Accept-Language: en-us
Connection: Keep-Alive