Send HTTP-1.1 Responses. #31

Open
wants to merge 2 commits into
from

4 participants

@ssmccoy
  • Despite not requiring the Host header or supporting keep-alives, send HTTP/1.1 response.
    • This will allow custom servers to actually use some HTTP/1.1 features, such as the cache-control header, even though clients are forced to delegate keep-alive behavior to their load-balancer.
    • When tested behind haproxy and friends, has no impact on upstream load-balancing.
ssmccoy added some commits Aug 13, 2012
@ssmccoy ssmccoy Send HTTP/1.1 responses.
 * Despite not requiring the ``Host`` header or supporting keep-alives, send an
   HTTP/1.1 response.
   * This will allow custom servers to actually use some HTTP/1.1 features,
     such as the cache-control header, even though clients are forced to
     delagate keep-alive behavior to their load-balancer.
   * When tested behind haproxy and friends, has no impact on upstream
     load-balancing.
09bfe03
@ssmccoy ssmccoy Added META and blib to ignore 851d30c
@miyagawa
Owner

I haven't fully grokked the patch yet, but i think it should respond 1.1 only if the request in question is in 1.1.

@ssmccoy

That's certainly not required. Here's what apache does:

GET / HTTP/1.0

HTTP/1.1 200 OK
Date: Mon, 27 Aug 2012 02:50:42 GMT
Server: Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 mod_python/3.3.1 Python/2.6.5
@vti
vti commented Sep 3, 2012

+1

With 1.0 no chunked and friends :(

@vti
vti commented Sep 3, 2012

Btw, why add Connection close? Isn't that only for 1.0?

@ssmccoy

You have to send Connection: close if you are going to close the connection. Otherwise HTTP/1.1 is keep-alive by default and you may wind up with some pipelined requests that will get dropped when you close the connection.

I didn't want to go through and implement keep-alives, because it was too much effort at this layer. In my current deployment, I push several Twiggy daemon processes to each box and have a local load balancer on the instance. The load balancer does keep-alives for me upstream.

Adding real keep alive support would be a significant change.

@vti
@vti
@ssmccoy
@dolmen

@vti What is the status of your fork for SockJS?

@vti

@dolmen usable under patched Feersum :) But I am doing some internal refactoring right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment