The Request-Response Lifecycle
Objectives
By the end of this lesson, you should be able to:
- Walk through every step between a user action and a rendered page
- Identify where DNS, TCP, and the actual HTTP exchange each fit in
- Explain what a backend server is specifically responsible for in this lifecycle
💡 Why this matters: Backend development is one piece of a longer chain. Knowing exactly where a backend server’s responsibility starts and ends helps place everything this course covers, routing, middleware, error handling, in the bigger picture.
The Full Lifecycle
Typing a URL into a browser and pressing enter triggers a chain of distinct steps:
1. DNS lookup - translate a domain name (example.com) into an IP address
2. TCP connection - establish a reliable connection to that IP address
3. TLS handshake - (HTTPS only) negotiate encryption for the connection
4. HTTP request - the browser sends a request over that connection
5. Server processing - the backend server figures out the correct response
6. HTTP response - the server sends the response back
7. Rendering - the browser processes the response (renders HTML, runs JS, etc.)
Where the Backend Fits
Steps 1 through 4 are handled by the network and the browser, entirely before any of your backend code runs. Step 6 and 7 happen after your code has already finished, they’re the response traveling back and the browser’s own job of displaying it.
Step 5, server processing, is the entire backend’s job, and it’s what this entire course is about. Once a request reaches your Express server, everything from that point until a response is sent back, matching the URL to the right code, checking permissions, querying data, deciding what to send back, is backend development.
A Concrete Example
Requesting https://example.com/products/42:
- DNS resolves
example.comto an IP address. - The browser opens a TCP connection to that address, and negotiates TLS since it’s HTTPS.
- The browser sends
GET /products/42 HTTP/1.1(Lesson 3). - The server receives this, looks up product
42, likely from a database, and builds a response. - The server sends back
200 OKwith the product’s data. - The browser receives this and renders it.
Every module from here forward in this course lives inside step 5. Everything before it (DNS, TCP, TLS) is infrastructure your code relies on but doesn’t directly control, everything after (rendering) is the browser’s job, not the server’s.
Try It
- List the seven steps of the request-response lifecycle from memory, without looking back at this lesson.
- Explain, in your own words, which single step is “backend development,” and which steps happen before your code ever runs.
- Explain what would happen to this lifecycle if step 1 (DNS lookup) failed, would the request ever reach your server at all?
Recap
- A full page load involves DNS resolution, a TCP connection, an optional TLS handshake, the HTTP exchange, and browser rendering, in that order.
- Backend development lives entirely inside the “server processing” step, everything before and after is outside a backend developer’s direct control.
- This course focuses entirely on that one step, doing it correctly, quickly, and securely.
Next lesson: static vs dynamic websites, and where APIs fit into the picture.