Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do any modern browsers ever issue an HTTP HEAD request?

Tags:

http

I understand what a HEAD request is, and what it could be used for. Will any standard, modern browser ever send a HEAD request? If so, in what context?

like image 232
MarkPflug Avatar asked Oct 30 '15 20:10

MarkPflug


1 Answers

A browser will send a HEAD request if that is explicitly requested in an XMLHttpRequest, but I'm fairly certain that the browser will never send a HEAD request of its own accord. My evidence is that the Tornado web server defaults to returning an error for HEAD requests and I've never heard of anyone running into problems related to this (or even being aware of it).

HEAD is mostly obsolete IMHO: on a dynamic web site it is unlikely to be significantly more efficient than a GET, and it can usually be replaced by one of the following:

  • Conditional GET with If-Modified-Since or If-None-Match (used for caching)
  • Partial GET with Range header (used for e.g. streaming video)
  • OPTIONS (used for CORS preflight requests)
like image 146
Ben Darnell Avatar answered Oct 27 '22 00:10

Ben Darnell