CHAPTER 1 · 3 lessons · 39 exercises
The round trips a web app makes
What goes back and forth between the browser and the server, and how many times it happens.
This chapter is about getting you to the point where, when somebody says "we split the frontend from the backend", you know what is being split from what.
The web app you have open right now is made of two kinds of round trip. One fetches the container for the screen (HTML, CSS, JavaScript); the other fetches the data that goes inside it (usually JSON). Once you can look at these two separately, "why is this page slow to load" and "why is the data the only thing missing" become two questions you can chase down separately.
There are three things to get through. The two kinds of round trip (what comes from where), where the HTML gets built (how CSR, SSR and SSG differ), and the round trip that fetches data (how a request is put together, the order things happen inside the server, how to read the number that comes back).
This course does not run any code. We have no real server here, so there is no way to send you a request and show it happening. What it is instead is the map that stops you getting lost once you do start getting your hands on it. The networking basics (HTTP, DNS, ports) are in the first chapter of the How computers work course, so going through that first is the quicker route.
The multiple-choice questions are all written by us — none of them are past exam papers. The mix-ups that are easiest to make are sitting in the choices, so the one you hesitated over is the one worth reading. Each explanation goes as far as why the other three are wrong.
Lessons in this chapter
Two kinds of round trip
- 01Two kinds of round tripOne round trip fetches the container for the screen, the other fetches the data inside it. This lesson gets you seeing them separately.Go to the exercises
Where the HTML gets built
- 02Where the HTML gets builtThe same screen can have its HTML built in three different places. You pick by which you want: a fast first paint, fresh data, or a light server.Go to the exercises
The round trip that fetches data
- 03The round trip that fetches dataWhat you send, what happens in order inside the server, and how to read the number that comes back. One round trip, taken apart.Go to the exercises