Networking and resource loading
Reuse connections and cached responses
Understand why later requests to the same origin can avoid repeated setup and sometimes avoid transferring the body entirely.
8 minute lesson
A first request may need DNS, transport setup, and a TLS handshake. Later requests can often reuse an existing connection instead of repeating all that work.
HTTP/2 and HTTP/3 can carry several requests over one connection. Reuse reduces setup cost, but server limits, network changes, and connection policies still affect what happens.
Caching can avoid more work. A fresh cached response may be used without contacting the server. A stale response can be revalidated and return a small 304 Not Modified response instead of another body.
This makes a repeat visit different from a first visit. Test both cases deliberately.
In the Network panel, reload once with the cache disabled and once with normal caching. Compare transferred size, status, and Timing details. Do not treat a warm local reload as representative of a new visitor.
Good cache policy helps stable versioned assets. HTML and frequently changing API data often need different rules.
Exercise: choose one stylesheet and compare its first and second request. Record whether the browser transferred the body again.
Lesson completed