Latest / CyberSecurity Summary / Learning HTTP/2: A Practical Guide for Beginners
Transcript
- 0:00Speaker 1: So for over a decade, the entire modern Internet was
- 0:03Speaker 1: essentially running on, well, the digital equivalent of dial-up duct tape.
- 0:08Speaker 1: And you probably never even noticed.
- 0:09Speaker 2: Yeah, it's actually wild to think about. Right.
- 0:12Speaker 1: I mean, we're talking about incredibly complex, super precarious workarounds,
- 0:16Speaker 1: just holding everything together. Like, open your web browser right now,
- 0:19Speaker 1: type in a URL, say a news site or a
- 0:22Speaker 1: social media feed. And hit enter.
- 0:24Speaker 2: And in the literal blink of an eye, you get
- 0:26Speaker 2: this massive, complex page right on your screen.
- 0:30Speaker 1: Exactly. And today we are looking at how a secret
- 0:34Speaker 1: experiment quietly saved the Web from just, you know, collapsing
- 0:38Speaker 1: under its own weight to make that kind of speed possible.
- 0:41Speaker 2: It is genuinely a marvel of engineering that it works
- 0:44Speaker 2: at all. I mean, we spent a massive chunk of
- 0:45Speaker 2: Internet history. Trying to drive modern Ferraris on a dirt
- 0:49Speaker 2: road that was built for bicycles back in the 1990s.
- 0:51Speaker 1: Just dodging potholes.
- 0:52Speaker 2: Pretty much. We just kept patching the potholes until we
- 0:55Speaker 2: finally had to, you know, tear up the road and
- 0:57Speaker 2: lay down fresh asphalt.
- 0:58Speaker 1: And that is exactly what we are diving into today.
- 1:01Speaker 1: I was reading Steven Luden and Javier Garza's breakdown of
- 1:04Speaker 1: this in their book, Learning HTTP2, A Practical Guide for Beginners.
- 1:09Speaker 2: It's a great read. Super detailed.
- 1:11Speaker 1: Yeah, it really is. So our mission for this deep
- 1:14Speaker 1: dive is to understand how the internet's original delivery mechanism
- 1:17Speaker 1: became dangerously bloated and the desperate hacks developers invented to
- 1:24Speaker 1: keep the machine running.
- 1:25Speaker 2: Plus how a totally invisible massive upgrade completely rewired your
- 1:30Speaker 2: daily browsing experience.
- 1:31Speaker 1: Okay, let's unpack this. Where does the story of this
- 1:34Speaker 1: invisible plumbing actually start?
- 1:36Speaker 2: Well, to appreciate how we fixed the web, we really
- 1:38Speaker 2: have to look at what it was originally built to do. Like,
- 1:41Speaker 2: The architecture we rely on didn't just appear out of nowhere.
- 1:43Speaker 1: Right. It has a history.
- 1:44Speaker 2: Exactly. The core concept actually traces way back to the
- 1:48Speaker 2: 1930s and 40s. This engineer named Vannevar Bush wrote an
- 1:51Speaker 2: essay in 1945 proposing a mechanical system he called the memex.
- 1:56Speaker 1: A mememex.
- 1:56Speaker 2: Yeah. He envisioned storing aggregate knowledge on microfilm that could
- 2:00Speaker 2: be linked together, kind of mimicking how the human mind
- 2:03Speaker 2: naturally associates data.
- 2:06Speaker 1: That's incredible. So the conceptual foundation of the Internet was
- 2:08Speaker 1: built around like mechanical desks and microfilm.
- 2:11Speaker 2: I mean, it was entirely conceptual at the time, but
- 2:14Speaker 2: the philosophy definitely stuck. Then in 1965, a visionary named
- 2:19Speaker 2: Ted Nelson coined the term hypertext.
- 2:21Speaker 1: Oh, I've heard of that.
- 2:22Speaker 2: Yeah. He proposed a docuverse, basically a system where information
- 2:26Speaker 2: was interlinked across computers and never deleted. And both of
- 2:30Speaker 2: those grand academic ideas eventually paved the way for Tim
- 2:33Speaker 2: Berners-Lee at CERN in 1989. Right.
- 2:36Speaker 1: The actual inventor of the World Wide Web.
- 2:38Speaker 2: Exactly. He actually built the physical system, creating HTTP 0.9
- 2:42Speaker 2: to share physics research. But, you know, the contrast with
- 2:45Speaker 2: today's web is just stark.
- 2:47Speaker 1: I can imagine.
- 2:47Speaker 2: Yeah. HTTP 0.9 was incredibly bare bones. It had exactly
- 2:51Speaker 2: one command, get T. And it could only fetch plain text.
- 2:54Speaker 2: There were no images, no complex CSS layouts. Definitely no video.
- 2:59Speaker 1: So it was basically a digital filing cabinet for passing
- 3:01Speaker 1: text-heavy index cards back and forth between scientists.
- 3:04Speaker 2: Pretty much, yeah. But fast forward to today, and Ludin
- 3:07Speaker 2: and Garza provide a pretty severe reality check in the book.
- 3:11Speaker 2: The average modern web page is over two megabytes in size.
- 3:15Speaker 1: Wow.
- 3:15Speaker 2: Yeah, and it requires the browser to fetch roughly 140
- 3:18Speaker 2: separate objects.
- 3:19Speaker 1: Right, 140.
- 3:20Speaker 2: Yeah. We're talking high-resolution images, custom fonts, complex styling files.
- 3:26Speaker 2: third-party analytic scripts, just a massive amount of individual pieces
- 3:30Speaker 2: that all have to be assembled instantly.
- 3:32Speaker 1: Here's where it gets really interesting because the protocol we
- 3:35Speaker 1: relied on to fetch those 140 objects for the vast
- 3:38Speaker 1: majority of the modern web's history was HTTP 1.1, which
- 3:44Speaker 1: came out way back in 1999.
- 3:46Speaker 2: Right, 1999, a totally different era. Yeah.
- 3:48Speaker 1: So trying to load a modern media-rich website with HTTP 1.1
- 3:52Speaker 1: is like sitting down at a restaurant ordering a massive
- 3:55Speaker 1: 140-course meal, but the waiter is forced to bring you
- 3:59Speaker 1: one single potato chip, then walk all the way back
- 4:01Speaker 1: to the kitchen, then bring you one sprig of garnish,
- 4:03Speaker 1: walk all the way back. I mean, it's agonizing.
- 4:05Speaker 2: It really is a great analogy.
- 4:06Speaker 1: So if the web was evolving so incredibly fast in
- 4:10Speaker 1: the early 2000s with video and interactive design, why on
- 4:14Speaker 1: earth did we stick with a protocol from 1999 for
- 4:16Speaker 1: over 15 years?
- 4:19Speaker 2: Well, the short answer is that HTTP 1.1 was actually
- 4:22Speaker 2: a monumental leap forward at the time. I mean, replacing
- 4:25Speaker 2: a foundational protocol is basically like trying to change the
- 4:29Speaker 2: engines on an airplane while it's in flight.
- 4:31Speaker 1: Super risky.
- 4:32Speaker 2: Incredibly risky. And version 1.1 introduced virtual hosting, meaning multiple
- 4:37Speaker 2: separate websites could finally live on one single server. It
- 4:40Speaker 2: also brought in keep-alive connections.
- 4:42Speaker 1: What does that mean?
- 4:43Speaker 2: So using your restaurant analogy, the waiter didn't have to
- 4:46Speaker 2: unlock the front door of the restaurant every single time
- 4:48Speaker 2: they brought you a potato chip.
- 4:49Speaker 1: Oh, okay. That helps a little.
- 4:51Speaker 2: Right. But you're right. It had fatal flaws when confronted
- 4:55Speaker 2: with a wave of complex media. To understand why it
- 4:58Speaker 2: ultimately strangled the web, we really have to look beneath
- 5:01Speaker 2: HTTP at the underlying mechanics of TCP.
- 5:04Speaker 1: TCP, or Transmission Control Protocol. That's the foundational layer beneath
- 5:08Speaker 1: the web, right? Like the actual shipping container for the data.
- 5:10Speaker 2: Exactly. Exactly. Think of HTTP as the language being spoken
- 5:15Speaker 2: and TCP as the actual telephone line connecting the two people.
- 5:19Speaker 2: Before a browser can even ask for a web page,
- 5:22Speaker 2: it has to establish that TCP connection with the server.
- 5:25Speaker 2: And this requires what engineers call a three-way handshake. The
- 5:29Speaker 2: client sends a synchronized packet, a SYN. The server replies
- 5:33Speaker 2: with a SYN-ACK, acknowledging it. Then the client sends an
- 5:37Speaker 2: ACK back.
- 5:38Speaker 1: So it's basically a digital walkie-talkie check, like, Are you there? Yes,
- 5:42Speaker 1: I'm here. Great, I hear you.
- 5:43Speaker 2: That's a perfect way to visualize it. But that walkie-talkie
- 5:46Speaker 2: check takes time. Light can only travel so fast through
- 5:49Speaker 2: fiber optic cables. Even before you ask for the website,
- 5:52Speaker 2: you are burning precious milliseconds just saying hello.
- 5:55Speaker 1: Right, because of physics.
- 5:56Speaker 2: Exactly. But the real bottleneck kicks in after the handshake.
- 5:59Speaker 2: There's a core concept in TCP called slow start. When
- 6:02Speaker 2: the connection opens, TCP doesn't just blast all two megabytes
- 6:06Speaker 2: of the web page to you at once.
- 6:07Speaker 1: It doesn't.
- 6:08Speaker 2: No, it sends a tiny, tiny amount of data... waits
- 6:11Speaker 2: for you to acknowledge receipt, and then doubles the amount
- 6:14Speaker 2: it sends the next time.
- 6:15Speaker 1: Okay, let me make sure I'm wrapping my head around
- 6:17Speaker 1: the packet math here, because Luden and Garza detail this
- 6:20Speaker 1: specifically in the book. A single TCP packet can hold
- 6:23Speaker 1: a maximum effective payload of about 1,460 bytes.
- 6:27Speaker 2: Right, that is a hard limit per packet, yes.
- 6:30Speaker 1: So if a server wants to send a 2-megabyte page...
- 6:33Speaker 1: It starts by sending just a handful of these tiny 1,460-byte packets.
- 6:37Speaker 1: Then it literally stops and waits.
- 6:39Speaker 2: Yeah, it just hangs out.
- 6:40Speaker 1: Wow. And once the browser says, got them, the server
- 6:45Speaker 1: doubles it to maybe eight packets, then waits again for
- 6:48Speaker 1: another walkie-talkie check. The authors calculate that it takes about
- 6:52Speaker 1: nine full round trips back and forth across an ocean
- 6:56Speaker 1: just to get the connection up to a speed where
- 6:58Speaker 1: it can finally send the bulk of that two megabytes.
- 7:00Speaker 2: Nine round trips, yeah. Yeah. And that's assuming a perfect
- 7:03Speaker 2: network with zero dropped packets, which almost never exists. Right.
- 7:07Speaker 2: That is the slow start penalty. Now, combine that underlying
- 7:10Speaker 2: delay with the flaws of HTTP 1.1 itself. The biggest
- 7:14Speaker 2: killer was head of line blocking.
- 7:16Speaker 1: Head of line blocking. Yeah.
- 7:19Speaker 2: In version 1.1, you can only request one object at
- 7:22Speaker 2: a time per connection. If the server delays sending one large,
- 7:26Speaker 2: clunky JavaScript file... Every other image and text file behind
- 7:30Speaker 2: it in the queue is completely blocked. The pipe is jammed.
- 7:34Speaker 1: Oh, that sounds awful.
- 7:35Speaker 2: It was. Furthermore, HTTP 1.1 didn't compress header data. Every
- 7:40Speaker 2: single time you asked for one of those 140 objects,
- 7:44Speaker 2: you were also sending massive uncompressed cookies back and forth. Oh, man.
- 7:48Speaker 2: We call them fat message headers. Sometimes the headers for
- 7:51Speaker 2: a simple request were actually larger headers. than the 4,460
- 7:55Speaker 2: byte TCP packet size limit.
- 7:57Speaker 1: Hold on, I have to challenge this slow start logic
- 7:59Speaker 1: for a second. If I'm sitting at home paying for
- 8:02Speaker 1: a gigabit fiber optic internet connection, why is my browser
- 8:05Speaker 1: purposely bottlenecking itself?
- 8:07Speaker 2: It's a fair question.
- 8:08Speaker 1: I mean, why would the founding engineers of the internet
- 8:10Speaker 1: build a system that intentionally throttles data, like a traffic light,
- 8:14Speaker 1: metering cars onto a highway during rush hour? That just
- 8:17Speaker 1: seems like a terrible design flaw.
- 8:19Speaker 2: Well, what's fascinating here is that traffic light is the
- 8:21Speaker 2: only reason the internet hasn't collapsed.
- 8:23Speaker 1: Yeah.
- 8:24Speaker 2: TCP was designed, above all else, to be conservative, blind,
- 8:28Speaker 2: and fair. When your computer connects to a server, the
- 8:31Speaker 2: server has no idea if you are on a blazing
- 8:33Speaker 2: fast gigabit fiber line or if you're on a terrible
- 8:36Speaker 2: self-connection in a tunnel or if a router in Chicago
- 8:40Speaker 2: is currently failing.
- 8:40Speaker 1: Oh, so it's flying blind.
- 8:42Speaker 2: Exactly. So TCP feels out the network carefully to avoid
- 8:46Speaker 2: causing catastrophic congestion. Its primary goal is preventing the complete
- 8:50Speaker 2: collapse of the global network by flooding it with too
- 8:53Speaker 2: much data at once.
- 8:54Speaker 1: Okay, that makes sense.
- 8:55Speaker 2: But that inherent fairness, that caution, is exactly what causes
- 8:59Speaker 2: page load delays for you when you're just trying to,
- 9:01Speaker 2: you know, read an article.
- 9:02Speaker 1: It's a protocol that forces you to wait in line
- 9:05Speaker 1: for files one by one, sends data in tiny, overly
- 9:10Speaker 1: cautious chunks, and bloats every single request with massive, uncompressed cookies.
- 9:15Speaker 1: That sounds like an absolute nightmare for developers trying to
- 9:18Speaker 1: build media-rich interactive sites in the 2010.
- 9:21Speaker 2: Oh, it was a daily headache. And because developers couldn't just,
- 9:24Speaker 2: you know, snap their fingers and change the underlying TCP
- 9:28Speaker 2: protocol of the entire global Internet, they had to get
- 9:31Speaker 2: incredibly creative at the application layer. Right.
- 9:33Speaker 1: They had to work with what they had. Exactly.
- 9:36Speaker 2: And this birthed the duct tape era of web performance.
- 9:40Speaker 2: Developers invented bizarre, highly complex workarounds just to trick HTTP 1.1
- 9:45Speaker 2: into moving faster. Ludin and Garza detail a few of
- 9:48Speaker 2: these specific hacks in the book. One of the earliest
- 9:51Speaker 2: was minification.
- 9:53Speaker 1: Stripping out code.
- 9:54Speaker 2: Essentially, yes. It was the practice of removing every single space, tab,
- 9:59Speaker 2: and line break out of the HTML and JavaScript ground
- 10:02Speaker 2: just to save bytes. You could reduce a simple file
- 10:04Speaker 2: from 186 bytes down to 92 bytes.
- 10:06Speaker 1: Wow, just deleting spaces.
- 10:08Speaker 2: Yeah. It made the code completely unreadable to human developers,
- 10:12Speaker 2: all just to squeeze a little more efficiency out of
- 10:14Speaker 2: that TCP slow start.
- 10:15Speaker 1: Because every byte mattered.
- 10:17Speaker 2: Every single one. Another massive workaround was spreading. Remember that
- 10:21Speaker 2: every single image on a page required its own individual
- 10:24Speaker 2: HTTP request, which caused that head of line blocking we
- 10:28Speaker 2: talked about.
- 10:28Speaker 1: Right, the traffic jam.
- 10:29Speaker 2: So developers would take dozens of tiny icons like the
- 10:34Speaker 2: home button, the magnifying glass, the social media logos, and
- 10:38Speaker 2: stitch them all together into one giant master image file.
- 10:42Speaker 1: Whoa, wow.
- 10:42Speaker 2: Yeah. Then they would write complex CSS code to essentially
- 10:47Speaker 2: frame and cut out just the tiny coordinate square they
- 10:50Speaker 2: needed to show on the screen. It was an incredible
- 10:53Speaker 2: amount of effort just to reduce the number of individual
- 10:56Speaker 2: requests going over the pipe.
- 10:57Speaker 1: That is wild to think about. You're building a literal
- 11:00Speaker 1: digital mosaic just to trick the browser.
- 11:02Speaker 2: It really was. And then there was sharding, which was
- 11:06Speaker 2: arguably the most desperate of all.
- 11:07Speaker 1: Sardy.
- 11:08Speaker 2: Yeah. Browsers eventually started limiting connections to a single host,
- 11:12Speaker 2: usually capping it at about six simultaneous connections per domain
- 11:15Speaker 2: to prevent overwhelming the server.
- 11:16Speaker 1: Okay, that makes sense.
- 11:17Speaker 2: But developers felt restricted by this. So they started spreading
- 11:21Speaker 2: a single website's files across multiple fake domain names. They'd
- 11:24Speaker 2: put images on imageserver-1, not. com, scripts on scriptserver-2-com, and
- 11:30Speaker 2: so on.
- 11:31Speaker 1: Wait, just to bypass the limit?
- 11:33Speaker 2: Exactly. The goal was to force the user's browser to
- 11:36Speaker 2: open up entirely new sets of six connections, totally bypassing
- 11:40Speaker 2: the browser's safety limit.
- 11:41Speaker 1: Sharding is totally like a group of friends trying to
- 11:44Speaker 1: get into an exclusive club, but the bouncer says, I'm
- 11:47Speaker 1: only allowing two of you in at a time.
- 11:48Speaker 2: Yes.
- 11:49Speaker 1: So the rest of the friends keep putting on fake mustaches,
- 11:51Speaker 1: changing their jackets, and walking up to the bouncer pretending
- 11:54Speaker 1: to be different people, just to sneak the whole group in.
- 11:56Speaker 2: Yeah.
- 11:58Speaker 1: But stepping back, I mean, it's absurd. We spent an
- 12:01Speaker 1: entire decade building incredibly complex, labor-intensive workarounds just to avoid
- 12:07Speaker 1: fixing the actual pipes.
- 12:08Speaker 2: We did, yeah. But you have to view it through
- 12:10Speaker 2: the lens of pure economics. It was absolutely necessary.
- 12:13Speaker 1: How so?
- 12:14Speaker 2: Well, even a 400 millisecond delay in page load time,
- 12:17Speaker 2: literally the blink of an eye, causes users to abandon
- 12:20Speaker 2: a site. In e-commerce, a slow page translates directly to
- 12:24Speaker 2: abandoned shopping carts and lost revenue. Time is literal money. Right.
- 12:28Speaker 2: Companies couldn't wait for a global standards committee to invent
- 12:32Speaker 2: and deploy a new protocol over five years. They had
- 12:35Speaker 2: to sell products today. So they used duct tape. Right.
- 12:38Speaker 1: That makes total sense. But obviously, the web couldn't survive
- 12:41Speaker 1: on duct tape and fake mustaches forever. Someone had to
- 12:44Speaker 1: actually step up, invent a new protocol, and prove it
- 12:48Speaker 1: wouldn't break the entire digital world.
- 12:50Speaker 2: And that catalyst came from Google in 2009. Two engineers,
- 12:55Speaker 2: Mike Belsha and Roberto Peon, proposed an experimental protocol called SPDY,
- 13:00Speaker 2: pronounced speedy.
- 13:01Speaker 1: Nice name.
- 13:02Speaker 2: Yeah. And Google was in a highly unique position. They
- 13:06Speaker 2: controlled the Chrome browser on the client side, and they
- 13:09Speaker 2: controlled massive high-traffic web servers on the back end.
- 13:12Speaker 1: Oh, they owned both ends of the pipe.
- 13:14Speaker 2: Exactly. Because they owned both ends, They could deploy this
- 13:18Speaker 2: new protocol at unprecedented scale on live traffic, gathering real-world
- 13:22Speaker 2: data without waiting for permission.
- 13:24Speaker 1: They essentially built a secret fast lane, specifically for Chrome
- 13:27Speaker 1: users accessing Google Sites.
- 13:29Speaker 2: That's a great way to put it. And the data
- 13:31Speaker 2: they gathered was just undeniable. SPDY was drastically faster. They
- 13:36Speaker 2: took this proof to the Internet Engineering Task Force, the IETF,
- 13:39Speaker 2: and it became the foundational blueprint for HTTP2, which was
- 13:42Speaker 2: officially published in 2015.
- 13:43Speaker 1: So this is the big upgrade.
- 13:45Speaker 2: Yep. HTTP2 brought a complete architectural rewrite to target the
- 13:50Speaker 2: bottlenecks of version 1.1, and it relied on three heavily
- 13:53Speaker 2: integrated features.
- 13:54Speaker 1: Let's break those down because this is the invisible magic
- 13:57Speaker 1: that runs the web today.
- 13:58Speaker 2: For sure. The foundational shift, the thing that makes everything
- 14:01Speaker 2: else possible, is binary framing. HTTP1. 1 was text-based. You could
- 14:07Speaker 2: literally read the raw network requests in English. HTTP2 translates
- 14:11Speaker 2: all that data into binary code at the framing layer.
- 14:14Speaker 2: slicing it up into tiny standardized tagged packets before sending
- 14:18Speaker 2: it over the wire.
- 14:19Speaker 1: Now, wait a minute. Why binary? If I'm a developer
- 14:22Speaker 1: and I want to debug my website, isn't making the
- 14:25Speaker 1: protocol unreadable to humans a massive step backward? So what
- 14:28Speaker 1: does this all mean for the actual mechanics of the web?
- 14:31Speaker 2: I mean, it's a trade-off for human readability, absolutely, but
- 14:34Speaker 2: a massive win for performance. Think of HTTP 1.1 text
- 14:37Speaker 2: like raw clay. It's messy, varying in size, and machines
- 14:41Speaker 2: spend a lot of processing power trying to figure out
- 14:43Speaker 2: where one piece of text ends and another begins.
- 14:46Speaker 1: Right, because text can be anything.
- 14:48Speaker 2: Exactly. Binary framing turns that clay into standardized Lego bricks.
- 14:53Speaker 2: Every piece of data is sliced into a predictable frame
- 14:55Speaker 2: with a specific header tagging exactly what it is and
- 14:58Speaker 2: what stream it belongs to. And because we have those
- 15:01Speaker 2: tagged Lego bricks, it unlocks the second huge feature, multiplexing.
- 15:07Speaker 1: Okay, how does binary framing enable multiplexing?
- 15:10Speaker 2: Remember head of line blocking in HTTP 1.1, where one
- 15:14Speaker 2: slow file jammed the whole pipe?
- 15:16Speaker 1: The traffic jam, yeah.
- 15:17Speaker 2: Because HTTP2 slices everything into those tagged binary frames, it
- 15:21Speaker 2: can interleave dozens of requests and responses simultaneously over one
- 15:26Speaker 2: single TCP connection.
- 15:28Speaker 1: Wow.
- 15:28Speaker 2: It's like taking the contents of a hundred different files
- 15:30Speaker 2: and shuffling them together like a deck of cards, sending
- 15:33Speaker 2: them all down one pipe, and having the receiving browser
- 15:35Speaker 2: instantly sort them out based on their tags. No file
- 15:38Speaker 2: ever blocks another file again.
- 15:40Speaker 1: Goodbye, head of line blocking. The traffic jam is officially cleared.
- 15:44Speaker 1: But what about the massive uncompressed cookies we talked about?
- 15:48Speaker 2: Ah, that brings us to the third feature, HP Pay
- 15:50Speaker 2: header compression. And this isn't just standard zip compression. HPAA
- 15:54Speaker 2: uses something called delta encoding.
- 15:56Speaker 1: Delta encoding.
- 15:57Speaker 2: Yeah, think of it like a shared grocery list between
- 15:59Speaker 2: you and your partner. If you already have a massive
- 16:02Speaker 2: list on the fridge and you just want to add milk,
- 16:04Speaker 2: you don't rewrite the entire 50-item list on a new
- 16:07Speaker 2: piece of paper and hand it to them.
- 16:08Speaker 1: Right, you just say add milk.
- 16:10Speaker 2: Exactly. HPACK does exactly this. The browser and the server
- 16:15Speaker 2: keep a shared index of the headers. They only send
- 16:18Speaker 2: the tiny fraction of data that actually changed, the delta.
- 16:22Speaker 2: This practically eliminates the bloat that was previously choking the
- 16:25Speaker 2: early TCP slow start.
- 16:27Speaker 1: Okay, so the internet gets this shiny new hyper-efficient protocol.
- 16:32Speaker 1: But this leads to my favorite part of the story,
- 16:34Speaker 1: which we can call the great unlearning. Because transitioning to
- 16:37Speaker 1: HTTP2 isn't just about a server admin flipping a switch.
- 16:41Speaker 2: Oh, definitely not.
- 16:42Speaker 1: Ironically, to truly get the speed benefits, developers had to
- 16:46Speaker 1: actively destroy a decade of the web development best practices
- 16:49Speaker 1: they had just mastered.
- 16:51Speaker 2: It was a massive paradigm shift. Those brilliant duct tape
- 16:53Speaker 2: hacks we discussed earlier... Under HTTP2, they officially became anti-pattern.
- 16:59Speaker 1: Anti-pattern.
- 17:00Speaker 2: Practices that actually harm your website's performance.
- 17:03Speaker 1: Okay, let's look at those anti-patterns. First, spriting, stitching all
- 17:07Speaker 1: those icons together into a mosaic.
- 17:10Speaker 2: Completely useless now. Because multiplexing makes requesting a hundred tiny
- 17:14Speaker 2: separate images virtually free over a single connection, there is
- 17:18Speaker 2: zero benefit to maintaining one giant complex sprite file.
- 17:22Speaker 1: Okay, what about sharding? creating those fake domain names to
- 17:25Speaker 1: get past the bouncer.
- 17:27Speaker 2: Sharding is actually highly detrimental under HTTP2.
- 17:31Speaker 1: Really?
- 17:31Speaker 2: Yeah. The whole genius of HTTP2 is that it optimizes
- 17:35Speaker 2: one single TCP connection, allowing it to warm up through
- 17:38Speaker 2: slow start and reach absolute peak efficiency. If you shard
- 17:42Speaker 2: your assets across five different domain names, you force the
- 17:45Speaker 2: browser to open five separate TCP connections.
- 17:48Speaker 1: Oh no.
- 17:48Speaker 2: Which means you pay the brutal slow start penalty five
- 17:51Speaker 2: separate times, You're actively punishing your own website.
- 17:54Speaker 1: It's like a golfer who spent 10 years perfectly calibrating
- 17:57Speaker 1: this weird, highly unnatural swing to compensate for using a
- 18:01Speaker 1: bent golf club. Then someone finally hands them a perfectly
- 18:04Speaker 1: straight state-of-the-art club and they slice the ball into the woods.
- 18:08Speaker 1: You have to completely unlearn your swing.
- 18:10Speaker 2: That's exactly what happened in the industry. But there was
- 18:13Speaker 2: one more major hurdle for widespread adoption, and it was
- 18:16Speaker 2: about security. The major browser vendors, Google, Mozilla, Apple, they
- 18:21Speaker 2: drew a hard line in the sand.
- 18:23Speaker 1: What did they do?
- 18:24Speaker 2: They collectively agreed that they would only support HTTP2 over
- 18:28Speaker 2: a secure encrypted TLS connection. In other words, HTTPS. If
- 18:33Speaker 2: you wanted the new speed, you had to encrypt your site.
- 18:36Speaker 1: But hold on. Doesn't establishing a secure encrypted connection add
- 18:39Speaker 1: another round-trip handshake? Doesn't that mean more walkie-talkie checks and
- 18:44Speaker 1: more milliseconds lost before the page loads?
- 18:47Speaker 2: It traditionally does add a step, but the engineers developed
- 18:50Speaker 2: a very clever workaround called ALPN, or Application Layer Protocol Negotiation.
- 18:55Speaker 1: How does that work?
- 18:56Speaker 2: Basically, during that initial security handshake to set up the encryption,
- 18:59Speaker 2: the browser whispers a secret code saying, hey, by the way,
- 19:03Speaker 2: I speak HTTP2 if you do. The server replies in
- 19:06Speaker 2: the same handshake, I do too, let's use it.
- 19:08Speaker 1: Wow, they just bypassed the extra step.
- 19:09Speaker 2: Exactly. They agree on the protocol while setting up the security,
- 19:12Speaker 2: completely avoiding the need for an extra time-wasting round trip.
- 19:16Speaker 1: That is incredibly slick. Yeah. But let's say I run
- 19:19Speaker 1: a website and I just refuse to upgrade. Or what
- 19:22Speaker 1: if you're using a 10-year-old device that hasn't been updated?
- 19:25Speaker 1: Do older browsers just break? Does my site drop off
- 19:28Speaker 1: the internet?
- 19:28Speaker 2: Not at all. And that graceful degradation was a crucial
- 19:31Speaker 2: design requirement. The protocol is fully backwards compatible.
- 19:35Speaker 1: Oh, that's good.
- 19:35Speaker 2: Yeah. If a modern browser connects to an old server
- 19:39Speaker 2: or an old browser connects to a modern server, the
- 19:42Speaker 2: ALPN whisper just fails. They don't agree on HTTP2. So
- 19:46Speaker 2: they both quietly shrug and fall back to speaking good
- 19:49Speaker 2: old HTTP 1.1.
- 19:51Speaker 1: So the user doesn't even notice.
- 19:53Speaker 2: Exactly. The user never sees a broken page or a
- 19:55Speaker 2: syntax error. The site just loads a little slower. It
- 19:58Speaker 2: was a brilliantly executed, entirely invisible migration.
- 20:02Speaker 1: So let's recap this incredible journey. We started with Tim
- 20:05Speaker 1: Berners-Lee's pure, simple, text-only web in the 90s, Then we
- 20:09Speaker 1: hit the bloated, choked bottleneck of HTTP 1.1, struggling under
- 20:13Speaker 1: the weight of megabytes of media.
- 20:15Speaker 2: Which led to all those hacks. Right.
- 20:17Speaker 1: That birthed the duct tape era of spriting, minifying, and sharding.
- 20:22Speaker 1: Developers doing whatever it took to keep the machine running.
- 20:25Speaker 1: And finally, Google's SPDY experiment led to the sleek, multiplexed
- 20:31Speaker 1: binary world of HTTP 2. Every single time you open
- 20:35Speaker 1: your phone and load Facebook or Twitter or or a
- 20:38Speaker 1: news site, and it all populates seamlessly, you're experiencing the
- 20:41Speaker 1: invisible magic of HTTP2 working brilliantly in the background.
- 20:46Speaker 2: It really is a triumph of engineering collaboration, but we
- 20:49Speaker 2: connect this to the bigger picture. There is a fascinating
- 20:52Speaker 2: caveat in Ludin and Garza's text that we really have
- 20:55Speaker 2: to acknowledge.
- 20:55Speaker 1: What's that?
- 20:56Speaker 2: The authors point out that today, third-party objects, things like
- 20:59Speaker 2: external ad networks, tracking pixels, analytics widgets, social media buttons,
- 21:03Speaker 2: they often make up a staggering 50% of the time
- 21:06Speaker 2: it takes to load a web page.
- 21:07Speaker 1: Wait, half the load time is just trackers and ads?
- 21:10Speaker 2: Often, yes. And here is the catch. Because those third-party
- 21:13Speaker 2: objects are hosted on external servers that the website owner
- 21:16Speaker 2: doesn't control, HTTP2' s single-connection multiplexing magic can't always save you.
- 21:21Speaker 1: Because they're on a different domain.
- 21:23Speaker 2: Exactly. Your browsers still have to go out and make new,
- 21:27Speaker 2: separate TCP connections to all those various ad servers, Suffering
- 21:31Speaker 2: new slow starts and new handshakes every time? It poses
- 21:35Speaker 2: a really challenging question for the future of the internet.
- 21:38Speaker 2: As we spend thousands of hours building faster, more highly
- 21:42Speaker 2: optimized protocols to deliver data, are we actually improving the
- 21:45Speaker 2: human experience of the web? Or are we just building
- 21:48Speaker 2: a much faster, more efficient highway for third-party trackers and
- 21:52Speaker 2: advertising algorithms to clog up all over again?
- 21:55Speaker 1: Wow, that is a heavy, sobering thought. I mean, we
- 21:58Speaker 1: completely fixed the internal plumbing. But maybe we're just pumping
- 22:02Speaker 1: more external noise through it faster than ever before. It
- 22:04Speaker 1: really makes you look at that loading bar differently.
- 22:06Speaker 2: It definitely does.
- 22:08Speaker 1: Well, that is all the time we have for today's
- 22:09Speaker 1: deep dive. The next time you click a link and
- 22:12Speaker 1: a massive digital world appears in front of you in
- 22:14Speaker 1: the blink of an eye, take a second to appreciate
- 22:17Speaker 1: the wild history, the duct tape, and the invisible architecture
- 22:20Speaker 1: making it all possible. Until next time, keep learning.