3 ms·
At least one reason could be that `sendfile` is useless when using HTTP/2 or HTTP/3, as you can no longer just dump the contents directly onto a socket. Whether
by YorickPeterse 11mo ago
At least one reason could be that `sendfile` is useless when using HTTP/2 or HTTP/3, as you can no longer just dump the contents directly onto a socket. Whether that actually makes a practical difference on modern hardware remains to be seen of course.
- koakuma-chan 11mo agoThere is nothing that prevents you from using sendfile and HTTP/2 at the same time. You still dump the contents directly into the socket.
- YorickPeterse 11mo agoYes there is: HTTP/2's and HTTP/3's framing of messages is such that you can't reliably dump a file as-is onto an HTTP/2 connection, as it may exceed the maximum size allowed by a frame.
- koakuma-chan 11mo agoYou can dump only the necessary part of the file. It does not have to be the whole file at once.