Skip to article content
FrontendXLesson 02 / 20

From URL to First Byte

Build an accurate mental model of what the browser does, from navigation and HTTP through parsing, rendering, storage, workers, security, and DevTools, so you can predict behavior and debug real pages.

beginner · about 30 minutes · 2 exercises

  • Predict
  • Explain

What you will be able to do

#
  • List the navigation steps from URL parsing to navigation commit.
  • Distinguish render-blocking, parser-blocking, and non-blocking resources.
  • Read navigation timing from the Navigation Timing API.

Overview

#

Navigation is a sequence of steps, and each one can fail or be slow.

The steps

  1. Parse the URL into scheme, host, path, and query.
  2. Resolve the host with DNS.
  3. Open a TCP connection, then a TLS handshake for https.
  4. Send the HTTP request.
  5. Receive the response headers and body.
  6. Commit the navigation and hand the document to a renderer.

Before the response arrives, the browser may keep showing the previous page, and once bytes arrive a speculative preload scanner starts fetching subresources early.

Blocking resources

A classic script in the head stops HTML parsing until it downloads and runs. defer and async change that. Stylesheets block rendering and can also block scripts that follow them.

Measuring it

The Navigation Timing API exposes responseStart, domContentLoadedEventEnd, and loadEventEnd. The gap between requestStart and responseStart is server and network time, not frontend time.

Questions to carry forward

  • When does the preload scanner run?
  • Why can a stylesheet block a script?
  • Which timing marks separate server time from client time?

Exercises

#

Reference answers and expected output are authored, not executed in this browser. Nothing you type is run, and there is no Run or Pass control on this page.

  1. Exercise 1Predict

    Given this head, in what order do the events fire? Mark the parser behavior.

    starter.html
    <head>
      <script src="a.js"></script>
      <script src="b.js" defer></script>
      <script src="c.js" async></script>
    </head>

    Reveal the reference answer
    reference.html
    a.js blocks parsing and runs before the rest of the document is parsed. b.js runs after parsing completes, in document order. c.js runs as soon as it is downloaded, in any order relative to b.js.

    Authored expected output: a.js runs during parsing; b.js runs after parsing; c.js runs when ready.

    A classic script without defer or async is parser-blocking. defer preserves order and waits for parsing. async runs whenever the download finishes.

  2. Exercise 2Explain

    Explain why a stylesheet in the head blocks rendering even though it does not block HTML parsing.

    Reveal the reference answer
    reference.text
    The browser refuses to paint with incomplete styles because that would cause a flash of unstyled content. It can parse HTML while CSS downloads, but it waits for the CSSOM before building the render tree and painting.

    Authored expected output: An answer about avoiding unstyled paint and waiting for the CSSOM.

    Parsing and rendering are separate stages. CSS blocks the render tree and paint, not tokenization.

Common misconceptions

#
  • DNS and TLS happen after the browser starts parsing HTML.
  • The load event fires before the DOMContentLoaded event.
  • A script in the head never delays parsing.

Follow-up practice

#
  • browser-internals-http-basics
  • browser-internals-html-parsing-dom

Related resources

#

Your progress

#

Answers, drafts and completion marks are stored only in this browser. Nothing is sent to a server and no account is used.

Verification: authored. Answers and outputs on this page are authored reference material, not executed results.

© 2026 FrontendX. All rights reserved.