Skip to content
Commitwise
Menu
Networking

What happens when you type a URL

The classic interview question, answered layer by layer. Covers URL parsing and HSTS, browser caches and service workers, DNS, TCP and TLS with real timings, HTTP/2 and HTTP/3, the CDN edge, load balancers, reverse proxies and the application, request tracing, and how the browser turns HTML, CSS and JavaScript into pixels, including async and defer, plus what's different for a mobile app.

intermediate

The core idea with one simple example.Step by step, with more examples and exercises.A cheat sheet: key APIs, gotchas and trade-offs.Internals, trade-offs and production pitfalls.

“What happens when you type shop.example into the browser and press Enter?” It’s one of the oldest interview questions because it has no bottom: every step hides another layer, and how deep a candidate can go, and where they choose to go deep, says a lot.

This lesson is the Networking section put together in order: the browser’s own checks, DNS, TCP, TLS, HTTP, the servers on the other side, and finally rendering. Each step is short and links back to the lesson that covers it fully. Along the way you’ll see real timings, so you know which steps cost the most, and what changes when the client is a mobile app instead of a browser.

New to some of these? Open what you need, or skip ahead.

Basics:The Networking lessons so far

This lesson ties together DNS, TCP vs UDP, TLS and HTTPS, HTTP/1.1, HTTP/2 and HTTP/3 and HTTP caching. You don’t need to have read them all; each step here explains itself in a few sentences.

Basics:Round trip

A round trip is the time for a message to reach the server and an answer to come back: a few milliseconds in the same city, 100 ms or more across an ocean. Most steps before the first byte of a page cost one round trip each, so distance and the number of steps decide how fast a page starts.

Part Not started

Before the request leaves: URL, caches, DNS, TCP and TLS

You type shop.example/orders and press Enter. Before any byte goes to shop.example, the browser works through these steps:

  1. Is it a URL or a search? shop.example/orders looks like a host and a path, so it becomes https://shop.example/orders (modern browsers try HTTPS first). best running shoes would go to the search engine instead.
  2. HSTS. If shop.example is on the browser’s HSTS list (from an earlier visit or the built-in preload list), http:// is rewritten to https:// without asking the network.
  3. Caches. If a service worker is installed for the site, it gets the request first and may answer from its own cache, even offline. Otherwise the browser’s HTTP cache may hold a fresh copy of the page. Either way, no network at all.
  4. DNS. The browser needs an IP address for shop.example. It checks its own cache, then asks the operating system, which asks the configured resolver (at home, the router or the provider; often an encrypted DNS service). The answer is cached for its TTL. See DNS.
  5. TCP connection. The browser connects to the IP on port 443: SYN, SYN-ACK, ACK, one round trip. See TCP vs UDP.
  6. TLS handshake. The browser sends the hostname and its key share, the server answers with its certificate, and both derive keys: one more round trip with TLS 1.3. The browser verifies the certificate chain. See TLS and HTTPS.
  7. The HTTP request goes out, encrypted: GET /orders, with headers like Host, Accept, Accept-Encoding, Cookie and User-Agent. If the server supports HTTP/2, it was agreed during the TLS handshake; if it advertised HTTP/3, the browser may use QUIC over UDP, which merges steps 5 and 6.

If the browser already has an open connection to shop.example from a moment ago, steps 4 to 6 are skipped entirely: the request goes out on the existing connection.

  • Input handling: omnibox heuristics (search vs navigation), IDN to Punycode with spoofing checks, HTTPS-first upgrades (Chrome’s HTTPS-Upgrades fall back to HTTP if HTTPS fails), HSTS (dynamic and preloaded), and the browser’s own speculative work: DNS prefetch and preconnect while you type, prerendering of likely URLs.
  • Before the network: beforeunload of the current page, the back/forward cache for history navigations, service worker fetch handlers (navigation preload lets the network request start in parallel with worker boot), the HTTP cache (HTML is usually no-cache, so a conditional request).
  • DNS: browser cache, OS cache (mDNSResponder on macOS, systemd-resolved on Linux), hosts file, DoH or DoT to the resolver if configured, then recursive resolution. The browser may also query HTTPS records to learn about HTTP/3 and ECH before connecting, and races IPv6 against IPv4 (Happy Eyeballs).
  • Connection: TCP plus TLS 1.3 is 2 RTT before the request (1 RTT with TCP Fast Open, rarely used); QUIC is 1 RTT, or 0 with 0-RTT resumption (replayable, so only safe requests). Connection pooling and HTTP/2 coalescing (one connection for several hostnames on the same IP and certificate) avoid new handshakes.
  • Request: HTTP/2 or HTTP/3 with HPACK or QPACK header compression; Sec-Fetch-* headers describe the request’s context; cookies by SameSite rules; Accept-Encoding: gzip, deflate, br, zstd.
  • Measuring: Navigation Timing in the browser (domainLookupStart, connectEnd, secureConnectionStart, responseStart), curl -w on the command line, and real-user monitoring for what users actually experience.

Predict the output

curl fetched https://www.wikipedia.org/ twice from a laptop and printed the cumulative times below (seconds since the start). Roughly how long did the TLS handshake take on the first run?

curl -s -o /dev/null -w 'dns %{time_namelookup}  tcp %{time_connect}  tls %{time_appconnect}  ttfb %{time_starttransfer}  total %{time_total}\n' https://www.wikipedia.org/
# dns 0.012366  tcp 0.051183  tls 0.101307  ttfb 0.152796  total 0.244031
# dns 0.004432  tcp 0.041765  tls 0.087966  ttfb 0.136843  total 0.233632
# 1. DNS: which addresses, and how long they may be cached
dig +noall +answer shop.example A shop.example AAAA

# 2-3. TCP and TLS: the negotiated protocol and certificate
echo | openssl s_client -connect shop.example:443 -servername shop.example -alpn h2,http/1.1 2>/dev/null \
  | grep -E 'ALPN|Protocol|Verify return'

# 4. HTTP: the request and response headers curl sends and receives
curl -sv -o /dev/null https://shop.example/orders 2>&1 | grep -E '^[<>*] '

# all of it with timings
curl -s -o /dev/null -w 'dns %{time_namelookup} tcp %{time_connect} tls %{time_appconnect} ttfb %{time_starttransfer}\n' https://shop.example/
// in the browser console: the same phases for the current page
const [nav] = performance.getEntriesByType('navigation');
console.table({
  dns: nav.domainLookupEnd - nav.domainLookupStart,
  tcp: nav.secureConnectionStart - nav.connectStart,
  tls: nav.connectEnd - nav.secureConnectionStart,
  waitingForServer: nav.responseStart - nav.requestStart,
  download: nav.responseEnd - nav.responseStart,
});

Worked example: the first visit from a phone

  1. Input. On a phone in Belgrade, the user taps a link to https://shop.example/orders. No HSTS entry yet, but the URL is already HTTPS.
  2. No cache. First visit: no service worker, nothing in the HTTP cache.
  3. DNS, 30 ms. The phone’s resolver doesn’t have the name cached, so it asks the root, .example and the shop’s name servers. Answer: an IP of the CDN’s server in Frankfurt, TTL 300 seconds.
  4. TCP, 25 ms. One round trip to Frankfurt over mobile data.
  5. TLS, 25 ms. One more round trip; the certificate for shop.example checks out. HTTP/2 is agreed during the handshake.
  6. Request and wait, 120 ms. The CDN doesn’t have the page (HTML is personal), so it forwards the request to the shop’s servers in Ireland and waits for the answer.
  7. First byte at about 200 ms. The HTML starts arriving. On the next tap, DNS and both handshakes are already done, and only step 6 remains.
Deep diveMaking the first connection fasterInterview favorite

“Our landing page’s time to first byte is 600 ms on mobile. Where would you look?” Split the time into phases (Navigation Timing or RUM data by country and network type) and attack the biggest:

  • DNS: long-TTL records for stable endpoints, a fast authoritative provider with anycast, fewer distinct hostnames on the critical path (each third-party domain is another lookup and handshake), dns-prefetch for unavoidable ones.
  • Distance: every round trip is paid two or three times before the first byte. A CDN or edge terminating TLS near the user cuts each one from 150 ms to 20 ms, even when the HTML itself comes from a distant origin (the edge keeps warm connections to it).
  • Handshakes: TLS 1.3 everywhere, session resumption, HTTP/3 advertised through Alt-Svc and DNS HTTPS records, OCSP stapling no longer needed with short-lived certificates, a lean certificate chain (ECDSA, no extra intermediates) so the handshake fits in the first flight.
  • Connection reuse: one origin for the page and its API (no extra handshake, no CORS preflight), HTTP/2 coalescing, preconnect for the second origin you can’t avoid.
  • Server time: the waiting phase is the application. Cache rendered HTML at the edge for anonymous users, stream the HTML head early, and send 103 Early Hints so the browser starts fetching CSS while the server is still thinking.
  • Redirects: http:// to https:// to www. to /en/ is three extra round trips, each possibly with new DNS and handshakes. Collapse them into one, or none with HSTS preload.

Say how you’d verify: before and after RUM percentiles (p75 and p95, not averages) per region and connection type.

  • Browser: omnibox, IDN, HTTPS-first and HSTS, bfcache, service worker (navigation preload), HTTP cache; speculative preconnect and prerender.
  • DNS: browser → OS → resolver (DoH/DoT) → recursion; HTTPS records for h3 and ECH; Happy Eyeballs.
  • TCP + TLS 1.3 = 2 RTT before the request; QUIC 1 RTT (0-RTT for safe requests); reuse and coalescing skip it.
  • First-byte tuning: edge termination, fewer hostnames and redirects, resumption, HTTP/3, 103 Early Hints; measure with Navigation Timing and RUM percentiles.
curl -s -o /dev/null -w 'dns %{time_namelookup} tcp %{time_connect} tls %{time_appconnect} ttfb %{time_starttransfer}\n' https://host/

Check this part

  1. The browser already has an open connection to shop.example. Which steps does the next request skip?

  2. What can answer a request before it reaches the network at all?

  3. How many round trips before the HTTP request for a new TCP plus TLS 1.3 connection, and for a new QUIC connection?

  4. Which change cuts first-byte time most for distant mobile users?

The browser parses the input into a URL, upgrades it to HTTPS if HSTS says so, and checks its caches and any service worker. Then the network steps: DNS resolves the name (often cached), TCP connects (one round trip), TLS 1.3 sets up encryption (one more), and the HTTP request goes out, usually as HTTP/2, or HTTP/3 over QUIC, which combines the transport and TLS handshakes.

Part Not started

On the other side: CDN, load balancer and the application

The IP the browser connected to rarely belongs to “the server”. For most sites it’s a chain:

browser
  -> CDN edge (nearest city)           cached? answer now. not cached? forward
     -> load balancer                  picks a healthy app server
        -> reverse proxy (often)       TLS, compression, routing by path
           -> application server       auth, business logic
              -> cache / database      the data
  1. CDN edge. The DNS answer pointed to a CDNCDN (content delivery network)Servers in many cities that keep copies of your files and answer users from nearby, fetching from your origin only on a miss.Open in glossary → server near the user. For images, scripts and pages that are the same for everyone, it answers from its cache in a few milliseconds. For /orders, which is personal, it forwards the request to the origin, often over a connection it already has open. See HTTP caching.
  2. Load balancer. The origin’s entry point spreads requests over many identical app servers and skips the ones that fail health checks. See load balancerLoad balancerA component that spreads incoming requests across several servers.Open in glossary →.
  3. Reverse proxy. NGINX, Envoy or similar may sit in front of the app to route /api and / to different services, compress responses and enforce limits.
  4. Application. The code reads the session cookie, finds the user, loads their orders from a cache or database, renders HTML or JSON, and sets headers like Content-Type, Cache-Control and Set-Cookie.
  5. Back the same way. The response travels back through each hop. The CDN may store it if its headers allow, and the browser receives the first bytes.

Each hop adds a little time and a place where things can fail, which is why the status codes from the HTTP lesson matter: a 502 or 504 tells you which hop gave up.

  • Edge: anycast or GeoDNS routing to a point of presence, TLS termination, WAF and bot rules, rate limiting, cache lookup by cache key, request collapsing, edge functions (redirects, A/B routing, auth checks), tiered caching with an origin shield.
  • Load balancing: L4 (by connection; preserves end-to-end TLS) or L7 (by request; HTTP routing, retries, gRPC awareness); algorithms (round robin, least requests, consistent hashing for cache locality); health checks, connection draining, and timeouts that must decrease from the edge inward so the outer hop doesn’t give up first and retry blindly.
  • Forwarding metadata: X-Forwarded-For, X-Forwarded-Proto, the standard Forwarded header, or PROXY protocol at L4; trust only values set by your own proxies.
  • Application: middleware (authentication, rate limits, CORS), handler, data access with connection pools, caches (cache-aside, Redis), queues for slow work; HTML streaming so the head goes out before the slow parts are ready.
  • Tracing: a request ID generated at the edge and logged by every hop, the W3C traceparent header for distributed tracing (OpenTelemetry), and Server-Timing response headers that show backend phases in the browser’s DevTools.

Predict the output

These headers came back with a page. What do they tell you about where the response came from?

HTTP/2 200
cache-control: public, max-age=60, s-maxage=3600
age: 1187
cf-cache-status: HIT
content-type: text/html; charset=utf-8
// application: log with the ID, and show backend timing in the browser's DevTools
app.use((req, res, next) => {
  const id = req.get('X-Request-ID') ?? crypto.randomUUID();
  const start = performance.now();
  res.set('X-Request-ID', id);
  res.on('finish', () => log.info({ id, path: req.path, status: res.statusCode }));
  res.locals.timing = (name: string) => res.append('Server-Timing', `${name};dur=${(performance.now() - start).toFixed(1)}`);
  next();
});
# NGINX reverse proxy: reuse the edge's ID or create one, pass it on, log it
map $http_x_request_id $req_id {
    default $http_x_request_id;
    ""      $request_id;
}
log_format main '$remote_addr "$request" $status $request_time rid=$req_id';
server {
    location / {
        proxy_set_header X-Request-ID $req_id;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://app;
        add_header X-Request-ID $req_id always;
    }
}

Practice: where did the time go?

Exercisemedium

Reading a slow request

A user in Australia says the orders page is slow. You get these numbers for one load (milliseconds, each step on its own, not cumulative):

StepTime
DNS180
TCP connect290
TLS300
Waiting for the first byte950
Download40

The servers are in Ireland, with no CDN.

  1. Which steps are mostly about distance, and roughly what is one round trip here?
  2. The waiting time is 950 ms. How much of it is likely the network, and how much the application?
  3. Suggest one fix for each of the two problems.
›

TCP and TLS each cost about one round trip. The waiting time includes one round trip for the request and response, plus whatever the server spends.

SolutionTry it yourself first
  1. TCP and TLS are one round trip each, so a round trip from Australia to Ireland is about 290 to 300 ms. DNS at 180 ms suggests the user’s resolver also had to go far, or the name wasn’t cached.
  2. One round trip (about 300 ms) of the 950 is the network; the remaining ~650 ms is the server: the application, its database queries, or both.
  3. Distance: put a CDN or edge in front, terminating TCP and TLS in Sydney, so the handshakes cost about 20 ms each; the edge reuses warm connections to Ireland. Longer DNS TTLs help repeat visitors. Server time: look at the application’s trace for this request ID: a slow query or a missing index is the usual suspect, then caching. Measure again afterwards.
Deep diveFollowing one request through the backendInterview favorite

“A user reports that checkout sometimes takes ten seconds. How do you find out why?” This tests observability, which is the server-side half of “what happens when you type a URL”.

  1. Get an identifier. If responses carry X-Request-ID (or the trace ID from traceparent), support can capture it from the user, or you find their requests by user ID and time in the logs. Without IDs, you’re correlating timestamps across a dozen services.
  2. Find the trace. With distributed tracing (OpenTelemetry to Jaeger, Tempo, Honeycomb or a vendor), one trace shows every hop as a span: edge, load balancer, API gateway, checkout service, payment call, database queries, with timings.
  3. Read the shape. A long span with nothing inside it means time inside one service (CPU, GC pause, lock, pool wait). Many short sequential spans mean an N+1 query or chained calls that could run in parallel. A span ending at exactly 5 s or 10 s is a timeout followed by a retry.
  4. Check if it’s systemic. Look at latency percentiles by endpoint and by dependency: p99 of the payment provider, connection pool saturation, a single slow instance (look at the load balancer’s per-target latency), a noisy neighbour, cold starts.
  5. Confirm and fix. Reproduce with the same inputs, fix (index, parallel calls, timeout plus circuit breaker, pool size), and add an alert on the percentile that caught it.

Points that impress: sampling strategy (tail-based sampling keeps the slow and failing traces), propagating context through queues (trace IDs in message headers), Server-Timing to expose backend phases to front-end RUM, and making sure every log line from every hop carries a request ID.

  • Edge (anycast PoP, TLS, WAF, cache key, request collapsing, shield) → L4/L7 load balancer (health checks, draining, timeouts decreasing inward) → reverse proxy → app → caches and databases.
  • Forwarding headers (X-Forwarded-*, Forwarded, PROXY protocol) trusted only from your own hops.
  • Request IDs on every log line, W3C traceparent with OpenTelemetry, tail-based sampling, Server-Timing for DevTools and RUM.
  • Debugging slowness: one trace’s shape (long span, N+1, timeout plus retry), then percentiles per dependency and per instance.
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
Server-Timing: db;dur=212.4, render;dur=38.0

Check this part

  1. The response header says cf-cache-status: HIT. Did the application handle the request?

  2. What does a load balancer do?

  3. Why should timeouts get shorter from the edge inward?

  4. A trace shows 40 sequential 20 ms database spans in one request. What is the likely problem?

The request usually reaches a CDN edge first, which answers from cache or forwards it. Behind it, a load balancer picks a healthy server, a reverse proxy may handle TLS, compression and routing, and the application authenticates, queries databases and caches, and renders a response. Request IDs and trace headers connect the logs of every hop.

Part Not started

Turning bytes into pixels

The HTML arrives in pieces, and the browser doesn’t wait for all of it:

  1. Parse HTML into the DOM. As bytes arrive, the browser builds the DOM, a tree of the page’s elements. When it meets a <link rel="stylesheet">, an image or a script, it starts downloading it, usually over the same HTTP/2 connection.
  2. CSS blocks rendering. The browser won’t paint the page until the stylesheets in the head are loaded, because painting without them would show unstyled content and then jump. Big CSS files delay the first paint.
  3. Plain scripts block parsing. A <script src> without attributes stops the HTML parser until the script is downloaded and run, because the script might change the page. That’s why scripts go at the end of the body or get one of two attributes:
    • defer: download in parallel, run after the HTML is parsed, in document order, before the DOMContentLoaded event.
    • async: download in parallel, run as soon as it arrives, in any order. Good for independent scripts like analytics.
  4. Style, layout, paint. The browser combines the DOM with the CSS, calculates where every box goes (layout), and draws the pixels (paint). Then JavaScript can make the page interactive, and more requests (API calls, images further down) follow.

Two events mark progress: DOMContentLoaded when the HTML is parsed and deferred scripts have run, and load when images and everything else are finished too. What users feel is better described by Core Web Vitals: how fast the main content appears (LCP), how fast the page reacts to a tap (INP), and how much it jumps around (CLS).

In a mobile app there’s no HTML to parse: the UI is already in the app. But when a screen loads data, the API call goes through the same steps as before: DNS, TCP, TLS (unless the connection is reused), the request, the CDN, the load balancer and the application. Then the app decodes the JSON and updates the screen.

  • Preload scanner: a secondary parser finds resources (scripts, styles, images) ahead of the blocked main parser, so even blocking scripts don’t serialize downloads; resources injected by JavaScript are invisible to it.
  • Priorities: CSS and fonts in the head are highest; fetchpriority="high" for the LCP image; loading="lazy" for below-the-fold images; <link rel="preload"> for late-discovered critical files (fonts, hero image); modulepreload for module graphs.
  • Scripts: type="module" is deferred by default; async and defer scripts both don’t block parsing, but async ones block it briefly when they execute; long tasks over 50 ms delay interaction (INP).
  • Rendering pipeline: DOM + CSSOM → style → layout → paint → composite; layout thrashing (reading layout after writes in a loop) and large DOMs cost frames; transform and opacity animate on the compositor without layout.
  • Rendering strategies: server-side rendering or static HTML gives content before JavaScript runs; client-side rendering waits for the bundle and then for API calls (a waterfall); streaming SSR and islands send HTML early and hydrate only interactive parts.
  • Mobile apps: cold start, then the API waterfall: prefetch on launch, reuse one HTTP client (connection pool), cache responses, and avoid chains of dependent requests on the first screen.

Predict the output

A page contains the scripts below, then a paragraph and an inline script that logs 'inline-end'. defer-slow and async-slow are served with a delay (600 ms and 900 ms); the -fast scripts have none. Each script, and a DOMContentLoaded listener, pushes its name to a log. In what order do the entries appear?

<script defer src="/js?n=defer-slow&d=600"></script>
<script defer src="/js?n=defer-fast&d=0"></script>
<script async src="/js?n=async-slow&d=900"></script>
<script async src="/js?n=async-fast&d=0"></script>
<p>body</p>
<script>log.push('inline-end')</script>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Your orders</title>

  <!-- connect early to the one other origin we need -->
  <link rel="preconnect" href="https://img.shop.example">

  <!-- small critical CSS; the file name changes with every build, so it caches for a year -->
  <link rel="stylesheet" href="/assets/app.4b1e9c.css">

  <!-- the font the first screen needs, discovered early -->
  <link rel="preload" href="/assets/inter.woff2" as="font" type="font/woff2" crossorigin>

  <!-- app code: doesn't block parsing, runs in order after it -->
  <script type="module" src="/assets/app.8d2f1c.js"></script>

  <!-- independent analytics: whenever it arrives -->
  <script async src="https://analytics.example/a.js"></script>
</head>

A slow first paint

Spot the bugWhy does the page stay white for two seconds?

Tap the line with the bug.

<head>
  <title>Shop</title>
  <link rel="stylesheet" href="/css/site.css">
  <script src="https://chat-widget.example/loader.js"></script>
  <script src="/js/app.js"></script>
</head>
<body>
  <h1>Today's deals</h1>
</body>

Deep diveAnswering the question in an interviewInterview favorite

The question is broad on purpose. A strong answer has a structure, stays short at each layer, and then goes deep where the interviewer leans in or where your experience is.

A five-minute skeleton:

  1. Browser: parse the input, HSTS and HTTPS-first, service worker and HTTP cache.
  2. DNS: browser, OS, resolver, recursive resolution, TTLs; an HTTPS record may advertise HTTP/3.
  3. Connection: TCP handshake, TLS 1.3 with certificate verification and ALPN, or QUIC; connection reuse.
  4. Request: HTTP/2 request with headers and cookies, through a CDN edge, load balancer and reverse proxy to the app, which authenticates, queries and renders.
  5. Response: status, caching headers, compression, back through the hops, maybe stored at the edge.
  6. Rendering: streaming HTML parse, CSS blocks render, scripts with defer or async, preload scanner, layout, paint, then hydration and API calls.

Where to go deep, depending on the role:

  • Mobile: connection reuse in one HTTP client, network changes (QUIC migration), certificate pinning, offline caching, cold start plus API waterfall.
  • Backend: load balancing, timeouts and retries, caching layers, database access, tracing a request.
  • Frontend: critical rendering path, Core Web Vitals, rendering strategies, bundles and caching.
  • Infrastructure or security: anycast and BGP, DNS security, TLS termination, WAFs, DDoS protection.

Mistakes to avoid: listing steps without the reason they exist; forgetting caching and connection reuse (most real requests skip half the steps); claiming the IP belongs to “the server” when it’s a CDN; and running out of time in the DNS hierarchy before reaching the application. Offer numbers where you can: a round trip, a handshake, a cache hit, and what each optimization saves.

  • Streaming HTML parse plus preload scanner; CSS blocks render; classic scripts block parsing; defer and modules run in order before DOMContentLoaded; async runs on arrival, any order.
  • Priorities: preconnect, preload, fetchpriority, loading="lazy"; avoid JS-injected critical resources.
  • Pipeline: style, layout, paint, composite; Core Web Vitals LCP, INP, CLS. SSR or streaming SSR beats client-side waterfalls.
  • Mobile apps skip HTML but pay DNS, handshakes and the API waterfall: one pooled client, prefetch, cache.
<script type="module" src="/assets/app.8d2f1c.js"></script>   <!-- deferred by default -->
<script async src="https://analytics.example/a.js"></script>

Check this part

  1. Two scripts have the defer attribute. In which order do they run?

  2. What happens when the parser meets <script src="app.js"> with no attributes?

  3. Which resources can the preload scanner not discover early?

  4. What makes a client-side-rendered page slow on a cold mobile visit?

The browser parses HTML into the DOM as it arrives and fetches what it references. CSS blocks rendering until it is loaded; plain scripts block parsing. defer scripts run in order after parsing, before DOMContentLoaded; async scripts run as soon as they arrive, in any order. Then style, layout and paint produce pixels. A mobile app skips the HTML but pays the same DNS, TCP, TLS and server costs for its API calls.

Key takeaways

  • Before the network: URL parsing, HSTS, service worker and HTTP cache may answer without any request.
  • A new connection costs DNS, a TCP round trip and a TLS round trip before the request; reused connections skip all three.
  • The IP usually belongs to a CDN edge; behind it come a load balancer, a reverse proxy and the application.
  • The browser parses HTML as it arrives; CSS blocks paint, plain scripts block parsing, defer and async avoid it.
  • Mobile apps pay the same network steps for every API call on a new connection.
  • Answer with structure (browser, DNS, connection, request path, response, rendering), then go deep where the role needs.
  • Handshake round trips times distance dominate first-byte time: edge termination, reuse, HTTP/3, fewer redirects and hostnames.
  • Request IDs and traces make the server side observable; timeouts shrink inward.
  • Critical rendering path: preload scanner, priorities, defer and modules, SSR over client-side waterfalls; measure with Core Web Vitals.

Finished this page?Nice work, this page is complete!

Mark it as done to track your progress. It's saved in this browser, no account needed.

Its cards are now in your Bites review ⚡
Esc

Type to search the whole site.