loggerhead performs more work than is necessary to answer HEAD request

Bug #716217 reported by John A Meinel
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
loggerhead
Triaged
Low
Unassigned
loggerhead-breezy
Triaged
Low
Unassigned

Bug Description

This is a bit of an extension of bug #716201. That bug is originally that we return the BODY content for a HEAD request, which is in pure violation of the http spec.

This bug is that even though we suppress the body content (once bug #716201 is fixed) we still do more work than is strictly necessary to get to the point where we can answer a HEAD request.

The current fix for bug #716201 is to generate the BODY but throw it away.

Looking at the code, it appears it would be easy to at least not render the content. The layering in loggerhead.controllers.TemplatedBranchView means that we have to call self.get_values() before we call 'start_response'. Which is where all the bzrlib side of the work is being done. However, we could trivially notice that the request was HEAD before we load the template and expand it.

To go a step beyond that would probably require a new api than 'get_values()'. Currently get_values() is where we get enough information to set headers.

Note that stuff like ChangeLogUI doesn't actually set any headers. And the current HEAD response gives:
HTTP/1.0 200 OK
Server: PasteWSGIServer/0.5 Python/2.6.4
Date: Thu, 10 Feb 2011 02:46:10 GMT
Content-Type: text/html
Connection: close

All of that we know as soon as we determine that we *have* a controller that could respond to the given URL. (so there exists a branch at that location, and the part after the branch is in the controllers dict. (/changes, /+filediff, etc))

Related branches

Gavin Panella (allenap)
Changed in loggerhead:
status: Confirmed → Triaged
Jelmer Vernooij (jelmer)
Changed in loggerhead-breezy:
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.