Among the headers described thus far, the date-related ones (Date, Last-Modified, and Expires/Cache-Control) are usually easy to produce and thus should be computed for HEAD requests just the same as for GET requests.
The Content-Type and Content-Length headers should be exactly the same as would be supplied to the corresponding GET request. But since it may be expensive to compute them, they can easily be omitted, since there is nothing in the specification that requires them to be sent.
What is important is that the response to a HEAD request must not contain a message-body. The code in a mod_perl handler might look like this:
# compute the headers that are easy to compute # currently equivalent to $r->method eq "HEAD" if ( $r->header_only ) { $r->send_http_header; return OK; }
If a Squid accelerator is being used, it will be able to handle the whole HEAD request by itself, but under some circumstances it may not be allowed to do so.
 
Continue to: