iOS: Are there any drawback by setting assumesHTTP3Capable to true if the server doesn't support it?

Are there any drawbacks (e.g. slower request) by setting assumesHTTP3Capable to true if the server doesn't support it? Is it OK to set it globally in the app for all URLRequests or it should be set depending on to which server the app makes the request? Thanks!

Accepted Reply

Are there any drawbacks [to] setting assumesHTTP3Capable to true if the server doesn't support it?

Yes.

HTTP/3 uses QUIC, not TCP. By default CFNetwork will start with an HTTP/2 connection and, as part of that handshake, learn that the server supports HTTP/3 and switch over for subsequent connections. The goal of assumesHTTP3Capable is to avoid that initial HTTP/2 work.

However, if you set assumesHTTP3Capable for a server that only supports HTTP/2 then CFNetwork will initiate an HTTP/3 connection, detect that failure, and then fall back to HTTP/2. It’s doing extra work for no benefit.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Replies

Are there any drawbacks [to] setting assumesHTTP3Capable to true if the server doesn't support it?

Yes.

HTTP/3 uses QUIC, not TCP. By default CFNetwork will start with an HTTP/2 connection and, as part of that handshake, learn that the server supports HTTP/3 and switch over for subsequent connections. The goal of assumesHTTP3Capable is to avoid that initial HTTP/2 work.

However, if you set assumesHTTP3Capable for a server that only supports HTTP/2 then CFNetwork will initiate an HTTP/3 connection, detect that failure, and then fall back to HTTP/2. It’s doing extra work for no benefit.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you!