Networking
Loading
Loading
Networking
DNS, TCP, TLS and HTTP — what each one costs, and why the first request is always the slow one.
By the end of this chapter
By the time a request handler executes, several round trips have already happened. Counting them is the cheapest performance work available, because each one is a fixed cost you pay regardless of how fast your code is.
Everything in this section is one of four moves, and it is worth being able to name which one you are making.
| Move | What it does | Best for |
|---|---|---|
| Get closer | Serve from a location near the user | Static assets, cacheable reads |
| Reuse the connection | Avoid repeating handshakes | Chatty clients, service-to-service |
| Send less | Compress, paginate, trim fields | Large payloads on slow links |
| Send less often | Batch, coalesce, cache client-side | High-frequency small calls |
Sign in to keep a note here. It is free, and nobody else can see it.
Sign inWhat this chapter was for: