Announcements

Latest updates and project highlights

Follow the Fumiki Journey

Discover an easier way to learn Markdown with step-by-step tutorials, syntax references, and hands-on examples built for developers.

Learn More

Currently Building

Exploring new ideas in software development, frontend technologies, and mobile app development while building practical solutions that solve real-world problems and enhance user experiences.

Learn More

What Really Happens When You Open a Website

Web Development HTTP Browser Rendering DNS
Profile picture of Prem Kumar Rajbhar
Prem Kumar Rajbhar Software Developer
Illustration of a browser request lifecycle from URL entry to page rendering

"A website feels instantaneous from the user's side. Behind the screen, a careful sequence of negotiations between the browser, the network, and the server must complete before a single pixel appears."

Most of my working hours are spent inside HTML, CSS, JavaScript, and responsive layouts. The code is what we touch directly, but it only becomes a website after the browser has resolved, requested, received, parsed, and rendered it. That full sequence is worth understanding, because it explains many of the performance and debugging problems frontend developers encounter daily.

This article follows a single page load from the moment a URL is entered to the moment the first frame is painted, written from a frontend developer's perspective.

1. The URL Defines the Destination

Every visit begins with a URL — a Uniform Resource Locator. Take a typical example:

url.txt
https://example.com/about

  https://      ->  protocol  (how the browser communicates)
  example.com   ->  domain    (where to connect)
  /about        ->  path      (which resource to request)

Each part does specific work. The protocol determines the scheme the browser will use; HTTPS adds an encryption layer on top of the underlying connection. The domain is the human-readable name of the server. The path identifies which page or resource is being requested.

The browser cannot proceed until these components are understood. The URL is effectively the set of instructions that sets everything else in motion.

2. DNS Resolves the Name into an Address

Humans remember names. Networks route packets to addresses. DNS — the Domain Name System — bridges that gap.

DNS is a distributed lookup system that maps a domain name to the IP address the browser needs in order to reach the correct server. If the answer is already cached locally, at the operating system level, or by the ISP, the lookup completes almost instantly. Otherwise, a resolver is consulted and the request travels up the hierarchy until an authoritative answer is returned.

From a frontend perspective, DNS is largely invisible. It is also one of the first places where latency accumulates, which is why DNS configuration affects the perceived speed of a site even though it happens entirely outside the application code.

3. A Secure Connection Is Negotiated

With an IP address resolved, the browser still needs a channel of communication with the server. On the modern web, that almost always means HTTPS.

The TLS handshake verifies the server's digital certificate, confirms the browser is speaking to the correct host, and negotiates the cryptographic keys used to protect the exchange. Once the handshake is complete, information can travel between the browser and the server without being readable to anyone observing the traffic.

Beneath TLS, the transport layer may use TCP or QUIC, and the application layer may use HTTP/1.1, HTTP/2, or HTTP/3. These protocols have evolved specifically to reduce latency and improve throughput. As frontend developers we rarely configure them directly, but they shape how quickly our pages reach users.

4. The Browser Issues an HTTP Request

With the connection established, the browser can ask for the resource. A minimal HTTP/1.1 request looks like this:

request.http
GET /about HTTP/1.1
Host: example.com

GET specifies the method — here, a request for the resource at the given path. The Host header identifies the site, which matters when multiple domains share an IP address. Real requests carry additional headers: cookies, accepted content types, caching directives, language preferences, and more.

The important distinction is that this is a request, not a download. The browser is asking the server a question, and the server decides how to answer it.

5. The Server Determines the Response

What happens next depends on how the website is built.

For a static site, the server may simply return an existing HTML file. For a dynamic application, the request may trigger application code, database queries, authentication checks, or calls to internal services before the response is assembled. An e-commerce product page, for example, is typically the result of a template rendered with product details, pricing, and stock availability fetched on demand.

The response itself contains three components:

  • A status code summarising the outcome
  • Headers describing the response — content type, caching rules, encoding, and more
  • A body containing the requested content, where applicable

Some status codes are familiar to anyone who has spent time on the web:

  • 200 OK — the request succeeded
  • 301 Moved Permanently — the resource now lives at a different URL
  • 404 Not Found — the requested resource does not exist
  • 500 Internal Server Error — the server failed while processing the request

When the response reaches the browser, the next phase begins.

6. HTML, CSS, and JavaScript Are Parsed

This is the stage where the work of a frontend developer directly enters the pipeline.

As HTML arrives, the browser parses it and begins constructing the DOM — the Document Object Model, a tree representing the structure of the page. Headings, sections, links, forms, and other elements become nodes in that tree.

CSS is processed alongside the markup. The browser builds the CSSOM, a parallel representation of the styling rules that apply to the DOM. Together, the DOM and the CSSOM inform everything that follows.

JavaScript occupies a different role. It can modify both trees, respond to user input, fetch data, validate forms, and update the interface without a full page reload.

A simple landing page illustrates the division of responsibilities clearly:

index.html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Landing Page</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <header><!-- navigation --></header>
    <main><!-- hero, projects, lead form --></main>
    <script src="main.js"></script>
  </body>
</html>

HTML defines structure. CSS defines appearance — layout, typography, colour, spacing, and responsive behaviour. JavaScript defines behaviour — menus, validation, sliders, and dynamic updates.

The browser does not wait for every resource to arrive before starting. As files stream in, parsing and processing begin, which is why a page can start appearing before all of its assets have finished loading.

7. The Browser Renders the Page

Parsing produces structure and style. Rendering produces pixels. The browser moves through several stages:

render-pipeline.txt
HTML  ->  DOM    \
                  \
                   ->  Render Tree  ->  Layout  ->  Paint  ->  Composite
                  /
CSS   ->  CSSOM  /
  • DOM and CSSOM construction — the browser builds in-memory representations of the page structure and its applicable styling
  • Render tree assembly — the browser determines which nodes and styles will actually appear on screen, excluding elements that do not render (such as those with display: none)
  • Layout — the position and size of each element is calculated
  • Paint — text, images, borders, backgrounds, and other visual details are drawn
  • Compositing — the painted layers are combined into the final image the user sees

These stages do not always run in a single linear pass. A change to the DOM or a style rule can trigger layout, paint, or compositing work again. How expensive that rework becomes depends on what changed and how the page is structured.

From a frontend perspective, this is where layout decisions, CSS complexity, image dimensions, and DOM depth all have consequences. The components we build eventually become individual pixels on a user's screen.

8. JavaScript Drives Interaction

A page that only renders correctly is not yet a working interface. Interaction is where JavaScript becomes essential.

Familiar examples include:

  • Clicking a menu icon opens the mobile navigation
  • Changing a filter updates the products listed on the page
  • Submitting a form runs validation and displays feedback
  • Switching a tab updates content without a full page reload

Some interactions are handled entirely in the browser. Others require a request to a server or an external API. In each case, the browser listens for events, executes JavaScript, updates the DOM, and re-renders only what is needed.

Frontend development, therefore, is not only about making a design look correct. It is about ensuring the interface responds predictably and gives users a coherent experience.

9. Why Some Websites Feel Faster Than Others

We have all used sites that feel instant and sites that feel sluggish. The difference comes from several overlapping factors:

  • Network conditions — high latency and low bandwidth delay every request
  • Server response time — slow processing pushes back the moment the browser can begin work
  • Resource size — unoptimised images and oversized scripts inflate the payload
  • Caching and CDNs — cached assets and geographically distributed delivery reduce round-trip time
  • JavaScript execution — heavy scripts can block the main thread and delay interaction
  • Rendering complexity — expensive layout and paint work can make even a simple interaction feel delayed
  • Device performance — low-end devices take longer to process and display the same page

As frontend developers, several of these are within our control. Optimising images, trimming unnecessary JavaScript, writing maintainable CSS, and loading resources in the right order all contribute. Performance is not only a question of how quickly a page appears — it is also about how quickly users can act and how smoothly the interface responds once they do.

Conclusion

A website is easy to take for granted. Behind the interface, a sequence of steps — DNS resolution, connection setup, HTTP request and response, parsing, rendering, and interaction — must all complete before anything appears on screen.

Understanding these steps gives frontend work a broader context. The code we write is the final layer of a much larger system, and that perspective makes us better at optimising, debugging, and building experiences that hold up under real-world conditions.

If you found this article useful, or would like to discuss any of these ideas further, feel free to connect. If you have a question or run into an issue, I am always happy to help where I can.