Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 03 · From Scratch · HTTP Server · with code: Go · about 22 min to read

Play it as a journeyTutor comes with a plan

HTTP Keep-Alive

Keep-Alive
Keep-Alive · Open board

Follows HTTP 04: Routing and Response, which taught the server to answer one question and then hang up, and hands off to HTTP Server: Concurrency.

Before you start. This series builds a small copy of a web server: a program that sits waiting on the network, reads one request (one question, like “give me this page”), and writes back an answer. So far the toy can already tell exactly where one request ends and the next would begin (HTTP 03: Frame The Body), and it can read a request, work out what it is asking for, and answer it once before closing the line (Parse The Request (HTTP), HTTP 04: Routing and Response). If the handshake that opens a connection is unfamiliar, TCP vs UDP, and the 3-way handshake in Networking shows it in one read.

Lesson 18 of 117 in From Scratch

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • October 1986: a line eight hundred times slower, overnight
  • The click: stop hanging up between questions
  • What one hang-up actually costs
  • Which side hangs up first?
  • The bug that answers a question nobody asked
  • The handshake and slow start, priced exactly
  • The version split, exactly
  • The framing bug, in full
  • The loop, in full
  • Pipelining: the optimisation that lost
  • The idle timeout is a resource decision

Terms it explains: twice, in, out, three different endings, a cap on reuse, deadlines on both directions, lower, in request order, head-of-line blocking, several connections per origin, Slowloris.

Review From Scratch