ACTION-710: Test the effect of HEAD Requests on Various Servers

A long time ago, I took an action to test HEAD requests to see how they 
were handled by servers.

What this is about
------------------
The hypothesis to check was that HEAD requests are usually treated as 
GET requests by Web Servers, except that the Web Server does not issue 
the HTTP response body. In particular, a HEAD request on a dynamic 
resource such as a JSP, PHP, ASP.NET page would execute the underlying 
code as though the request was a GET request (the code may handle the 
difference of course, but that's not the point here).


Conclusion
----------
The conclusion is that the hypothesis is correct.
And thus no change required to the guidelines here.

Sending a HEAD request or a GET request doesn't have an impact on most 
of the code at the application level.
[ This is quite logical actually, since the server needs to return the 
length of the response, and thus needs to generate the response and 
execute the code ]
It still has an obvious impact on the logs of a content provider (since 
the HTTP method is usually logged)



Why we wanted to know
---------------------
The reason why we wanted to investigate this was because of the 
following text in section 4.1.1 Applicable HTTP methods:
 
http://www.w3.org/2005/MWI/BPWG/Group/TaskForces/CT/editors-drafts/Guidelines/081107
  "A transforming proxy may convert a HEAD request into a GET request"

We wanted to make sure this didn't have any real consequence for content 
providers.


Tests conducted
---------------
I ran a couple of tests with most common server pages systems (JSP, PHP, 
and ASP.NET), basically by returning a static page completed with a 
final line of code that sends a message to the debug console. Sending a 
HEAD request also triggers the final line, meaning the code is indeed 
executed as if a GET request had been received.


I initially planned to do a complete review of all the possible 
combinaisons (how fool one can be sometimes).
I don't see any reason to pursue that any further actually.

Francois.

Received on Thursday, 13 November 2008 16:17:22 UTC