Transcript from the "Q29: HTTP 1, 2 & 3" Lesson
>> This is another kinda networking thing, promise this is the last one. What statements are correct? HTTP allows multiple requests and responses concurrently over a single TCP connection. HTTP/3 can be used only with HTTPS. HTTP/2 is backward compatible with HTTP/1.1. Or HTTP/1.1 requires multiple TCP connections to process multiple requests simultaneously.
[00:00:24] So the answer is all of them, [LAUGH] all of them right. Okay, so first, let's go back all the way in time when we had HTTP/1.0. And this HTTP always required a TCP connection before any response or a request could get sent. So we always had to have the SYNs and ACKs in before any requests get sent.
[00:00:42] So any file that you requested needed that. Then there was HTTP/1.1, which introduced the persistent connections. So multiple requests and responses could be sent over the same TCP connection. Now, if you have a single connection, resources always have to be delivered in full before it can switch to sending the new response.
[00:01:03] So this kinda go head-of-line blocking, which wasn't great because, yeah, it needed to wait for other responses to resolve, stuff like that. So then there was HTTP/2, which essentially allowed multiple requests and responses to be streamed over the same TCP connection, but also simultaneously. So you could kinda parallelize the requests and the responses.
[00:01:26] So this reduce latency and just improve resource usage in general. Now, we have kind of a new thing called HTTP/3. So this uses a new protocol called QUIC. So it's, I mean, I think it was introduced in 2020, but it's already used by, I believe, 25% of browsers at the moment or websites.
[00:01:50] So it's quite a lot, but it kind of gets rid of the entire TLS, or TCP and TLS, cuz that's all combined in a new protocol called QUIC. It also, again, has kind of streaming by default. So all the responses and requests can just be parallelized all at once.
[00:02:05] So this could massively improve your website's performance. But of course, it's up to your server whether you implement HTTP 3 or not, and also, if the browser supports it, which at the moment, I'm not entirely sure how many browsers support it. I think the majority does, like newer, modern browsers.
[00:02:23] Yeah, so HTTP allows multiple requests to be sent over a single TCP connection. That's right, as we just saw, you can finally do that. HTTP/3 can only be used with HTTPS. And this is true, because that QUIC protocol also has the TLS built-in. So the TLS is essentially what establish that secure connection.
[00:02:41] With HTTP/2, this wasn't necessarily required. You could also use it with HTTP, but HTTP/3, you cannot do that. HTTP/2 is backward compatible, yes, entirely. So you can serve your website from HTTP/1.1 or 2. And 1.1 required multiple TCP connections to process multiple requests simultaneously. That is true, at the same time, you cannot send multiple requests at the same time with HTTP/1.1.
[00:03:07] I think you can with something called like, is it called, not parallelizing, I don't know, something else, but it wasn't entirely reliable. Not many people did that.