Hi there, Julian asked me to contribute from my Apache httpd PoV on this use case, since I have implemented the HTTP/2 support there during the last year.
I had a quick look at the mod_xsendfile source and, while the code could benefit from some small optimizations and fix-ups, it should still work the same in Apache 2.4.x and also with the new HTTP/2 implementation. The use case described in the jackrabbit Wiki can be extended: - while sendfile() does not work for TLS, passing a file handle to the core output handlers allows for much more efficient connection handling compared to bit buckets. New 2.4.x event driven processing (mpm-event) can stream complete response data (and a file handle is the complete response in this case) without involving worker threads. That allows the server to handle many more active, concurrent connections. - For HTTP/2, handling multiple requests on a single connection is also more efficient using files. This avoids thread switches and worker allocation as well, making the server more responsive for other connections. - The advantage of operating system sendfile() does also hold for HTTP/2 in cleartext mode (h2c). While HTTP/2 sends data in frames, sendfile() is used for individual frame content, providing significantly higher throughput. Browsers may not use h2c, so a valid setup for this would be Apache behind a TLS terminating caching proxy that can talk h2c to the backend. tl;dr mod_xsendfile should allow significant performance/capacity benefits with HTTP/2 and also in presence of TLS. -Stefan
