~/VibeHandbook
$39

Chapter 03 · 03

The request and response cycle

Here is the dance, start to finish. You type an address, and behind the scenes this happens in a fraction of a second:

  CLIENT (your browser)                      SERVER (in a data center)
        |                                              |
        |   1. REQUEST                                 |
        |   "GET /products/shoes"  ------------------> |
        |                                              |  2. server thinks:
        |                                              |     looks up the shoes,
        |                                              |     builds the page
        |                                              |
        |   3. RESPONSE                                |
        |   <------------------  "200 OK + the page"   |
        |                                              |
   4. browser draws                                    |
      the page on screen                               |
        |                                              |

Four steps, every time:

  1. The client sends a request to a .
  2. The server processes it — maybe it looks something up, runs some logic, checks who you are.
  3. The server sends back a response: a status (did it work?) plus some content (the page, an image, some data).
  4. The client does something with the response — usually, draws it on your screen.

Loading one web page isn't one request — it's dozens. The browser asks for the page, then sees it needs images, fonts, and styles, and fires off a fresh request for each. Same dance, many times, very fast.

Want it offline?

Get the PDF + EPUB + downloadable prompt library + version updates.

$ Get the PDF — $39