2013-03-05 87 views
2

为什么Chrome会发送HEAD请求?例如,在日志:Chrome HEAD请求?

2013-03-04 07:43:51 W3SVC7 NS1 GET /page.html 80 - *.*.*.* HTTP/1.1 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.22+(KHTML,+like+Gecko)+Chrome/25.0.1364.97+Safari/537.22 

2013-03-04 07:43:51 W3SVC7 NS1 HEAD/- 80 - *.*.*.* HTTP/1.1 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.22+(KHTML,+like+Gecko)+Chrome/25.0.1364.97+Safari/537.22 

我有一个禁止系统,这头要求真的很烦人,其发生完全一样的第二,GET请求。

它的性质是什么?任何帮助赞赏。

p.s:我注意到头部的请求都只在我的主页上。

回答

0

RFC 2616状态:

9.4 HEAD 

The HEAD method is identical to GET except that the server MUST NOT 
return a message-body in the response. The metainformation contained 
in the HTTP headers in response to a HEAD request SHOULD be identical 
to the information sent in response to a GET request. This method can 
be used for obtaining metainformation about the entity implied by the 
request without transferring the entity-body itself. This method is 
often used for testing hypertext links for validity, accessibility, 
and recent modification. 

The response to a HEAD request MAY be cacheable in the sense that the 
information contained in the response MAY be used to update a 
previously cached entity from that resource. If the new field values 
indicate that the cached entity differs from the current entity (as 
would be indicated by a change in Content-Length, Content-MD5, ETag 
or Last-Modified), then the cache MUST treat the cache entry as 
stale. 

最有可能是试图验证客户端的cookie /会话与服务器有效。

+0

所以我猜服务器端代码仍然执行时发送HEAD请求?奇怪的是,只有少数人每天访问千次网站时才会发生...... – galgai 2013-03-05 18:31:00

+0

从本质上讲,如果会话发生更改,它应该只更改cookie值。由于请求发生在根文档'/'上,因此您的cookie值很可能是在整个域范围内设置的。如果您的根页面是动态的,它可能会通知客户端电子标签值是否更改。 (用于缓存)。有可能他们正在使用像McAffee的SiteAdvisor这样的浏览器插件,它可以在您的网站上做出自己的请求。 – 2013-03-05 19:02:56