Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick

HTTP/1.1 proxying

This HTTP/1.1 proxying is fun.

I made myself a little table for the different cases and my game plan:

              HTTP/1.0   HTTP/1.1
Default Conn  close      keep-alive
Chunked?      no         yes
Pipelining?   no         yes

Do only 1.1 connections to the backend nodes.

Client sends Perlbal gets          Send via   Find end via
------------ --------------------- ---------- -------------
1.0 request  1.1 response (w/len)  dumb copy  count bytes
1.0 request  1.1 response (chunk)  dechunk    watch chunks
1.1 request  1.1 response (w/len)  dumb copy  count bytes
1.1 request  1.1 response (chunk)  dumb copy  watch chunks

I figure the only CPU-heavy case will be 1.0 requests (rare) to chunked replies (rare), so that's really rare, and I don't need to optimize for it... I just need to do it correctly, which is a lot easier.

  • Ukraine

    Nobody reads my LiveJournal anymore, but thank you to everybody in Russia protesting Putin's insane war against Ukraine. (I know it's risky…

  • Happy Birthday!

    Happy 20th Birthday, LiveJournal! 🐐🎂🎉

  • hi

    Posting from the iPhone app. Maybe I'm unblocked now.

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.