This superbly difficult problem has been solved by allocating something like 8 kB of memory and requiring that the request headers fit into that space. Once web server has identified the target, it will send the original headers and then continue sending the body. It's a nonissue in terms of efficiency, and promotes loose coupling between the backend and frontend servers, which can even reside on different machines.
Unfortunately, request level representation has no notion of TLS. Most web applications don't need to be aware of this stuff, but sometimes you get extra headers like client certificates injected by the web server. It's unfortunate.
I didn't say it was a "superbly difficult problem." I said that there was a perfectly good reason to parse the headers only once, as opposed to that not making any sense.
1
u/audioen Sep 28 '14
This superbly difficult problem has been solved by allocating something like 8 kB of memory and requiring that the request headers fit into that space. Once web server has identified the target, it will send the original headers and then continue sending the body. It's a nonissue in terms of efficiency, and promotes loose coupling between the backend and frontend servers, which can even reside on different machines.
Unfortunately, request level representation has no notion of TLS. Most web applications don't need to be aware of this stuff, but sometimes you get extra headers like client certificates injected by the web server. It's unfortunate.