How the web works · A visual walkthrough
In this article, I’ll guide you through an overview of what happens when you navigate to a website using your browser. Whether you’re new to web development or have some experience, this post will help you gain a better understanding of how the web and its core technologies work.
Watch it first
The whole trip, behind the scenes
Press Play to follow one visit to https://www.exampleurl.com from the address bar to the finished page. Each stop is covered in detail further down. You can also step through it or jump to any stage with the numbered buttons.
Before we start
Two ideas everything else builds on
Before going into the details of every step included in the process, let's review some of the basic concepts we’ll be covering.
Computers connected to the internet are either clients or servers. A restaurant is a good way to picture the split:
In a restaurant
- The diner reads the menu and places an order.
- The kitchen keeps the recipes and ingredients, cooks the dish and sends it out.
On the web
- Clients the web user's devices and the software that those devices use to access the web.
- Servers computers that store web pages, sites, or apps and the files they need to be displayed in the user's web browser or devices.
1Stop one · the address
Finding a Resource: URLs
Each resource stored in a server can be located by clients using its valid associated URL. You may already know what a URL is, but let’s see in detail each one of its parts. Tap any part of the URL below. The colour shows who uses that part.
Scheme https:
The first part of an URL indicates the protocol that should be used to retrieve the resource. Websites use the HTTP and the HTTPS protocol, but we’ll see more details about this later. The : after the scheme is what separates it from the next part of the URL.
✉ Like choosing courier or registered mail.
Authority //www.exampleurl.com:443
This part is composed by the domain name and the port number separated by a colon. The port is only mandatory when the standard ports of the HTTP protocol (80 for HTTP and 443 for HTTPS) are not being used by the web server. The // before the domain name indicates the beginning of the authority.
✉ The building’s address, and which door to knock on. Here :443 could be left out, because 443 is the HTTPS default.
Path to resource
This is the abstract or physical path to the resource in the web server.
✉ The room inside the building.
Parameters ?key=value&…
A set of key/value pairs that add extra options to apply to the returning the requested resource. They are separated by a & and each web server has its own way to handle parameters. This section starts with ?.
✉ Special instructions written on the parcel.
Anchor #dns
This section, if present, starts by a # and is handled by the browser to display a specific part of the returned document. For example, it can point to a specific section in a HTML document.
✉ “Start reading at page 3.” The recipient handles it, the courier never sees it.
There are a few things that happen when you type a URL into your browser’s address bar that allow you to navigate to a site and interact with its content. Let’s see each one in detail.
2Stop two · the contact book
Matching IPs and URLs: DNS Resolution
While, as humans, we prefer domain names composed of words, computers communicate with each other using IP addresses. IP addresses are composed by numbers and are harder to remember for our human minds. The Domain Name System (DNS) is what puts together domain names and IP addresses.
Your phone’s contact book
You tap a name. The phone network only understands the number.
DNS
You type a name. Routers on the internet only understand the IP address.
Where the browser looks first
When you type a URL, the browser will first look into the local cache to see if the results for the DNS lookup are already stored. Then, it will equally check into the operating system cache. If there are no results stored, then the browser will call the DNS Resolver to try to find the associated IP address for the domain name.
What is the DNS Resolver?
The resolver is typically defined by your internet provider’s DNS, even though that’s the default most people use, and it is possible to change it to Google’s or Cloudflare’s or anything else you want.
8.8.8.8Cloudflare · 1.1.1.1…or anything else you wantAgain, the provider’s DNS might have the results for the domain name stored in its cache, if not, it will ask the Root DNS server.
What is the Root DNS Server?
The Root DNS server is a system that actually drives the entire internet. It is composed of thirteen servers distributed across the planet. It returns the query from the resolver with the relevant Top Level Domain server for the requested domain name.
At this moment, the DNS resolver will cache the IP of that Top Level Domain server so it doesn’t have to ask the Root DNS server again for it.
Precise versionThirteen servers, or thousands?
The thirteen are named root server identities, a.root-servers.net through m.root-servers.net. Each identity is run as many machines in many countries that share one address (a technique called anycast), so your resolver reaches whichever copy is nearest. In total there are well over a thousand physical root server instances.
What is the Top Level Domain Server?
The Top Level Domain (TLD) server stores the IP addresses of the authoritative name servers for the domain that the user is looking for. In the URL, www.exampleurl.com, the top-level domain is .com.
(authoritative NS). comtop-level domain
(TLD server)
.com, the .com TLD server knows who is authoritative for exampleurl.com, and that nameserver knows the address of www.exampleurl.com.Generic TLDs
.com .org .net
Country code TLDs
Usually the two-letter ISO country code: .uk .in .de
…and more
Other types exist beyond these two groups.
The TLD returns the authoritative name servers for the requested domain. One more time, the DNS resolver will cache the results so it doesn’t have to come back later for them.
Authoritative Nameserver
This server contains the DNS records that maps domain names to IP addresses. There is more than one name server attached to any domain.
| Name | Type | Value | Meaning |
|---|---|---|---|
| exampleurl.com | NS | ns1.exampleurl.com | nameserver #1 |
| exampleurl.com | NS | ns2.exampleurl.com | nameserver #2 (backup) |
| www.exampleurl.com | A | 203.0.113.10 | the IP address we need |
There is no caching involved at this point, because the authoritative nameserver is the highest authority and the latest piece in the DNS resolution chain.
The authoritative nameserver responds to the DNS resolver query with the domain name’s IP address.
It will respond with an error.
Then, the DNS resolver stores the IP and sends it back to the client’s browser. Once the DNS lookup is completed and the browser has the IP address, it can attempt to establish a connection with the server.
3Stop three · the road
Establishing a Connection: TCP/IP Model
The connection between client and server is established using the Transmission Control Protocol (TCP) and the Internet Protocol (IP). These protocols are the main ones behind the World Wide Web and other internet technologies, such as email, and determine how data travels across the network.
The TCP/IP model is a framework used to organize the different protocols involved in the internet and other network communications. The primary responsibility of TCP/IP is to divide the data into packets and send them to their final destination, ensuring the packets can be put back together on the other end of the communication.
This process follows a four-layer model, where data travels in one direction and then in the reverse direction when it reaches the destination:
Ports: numbered doors on one address
203.0.113.10The transport layer that ensures applications can exchange data by establishing data channels. It is also the layer that establishes the concept of network ports, a system of numbered data channels allocated for the specific communication channels that applications need.
The TCP/IP model’s transport layer includes two protocols that are most commonly used on the internet: the TCP and the User Datagram Protocol (UDP). TCP includes some capabilities that make it prevalent over most of the internet-based applications such as the web, so let’s focus on it.
TCP · a tracked, signed-for parcel
Connection first, then delivery. Lost pieces are sent again and everything arrives in order. Used by the web.
UDP · postcards
No connection setup. Each datagram is sent on its own, with no guarantee about delivery or order.
How Does TCP Connection Work?
TCP allows data to be transferred reliably and in order to its destination. It is a connection-oriented protocol, that means that the sender and the receiver must agree on connection parameters before actually establishing the connection. This process is known as the handshake procedure.
TCP Three-way Handshake
The handshake is a way for the client and the server to establish a secure connection and ensure that both parties are synchronized and ready to start exchanging messages. It works like the start of a phone call on a bad line.
ack=101 to seq=100 proves the server really received the client’s number. The client does the same with the server’s 300.4Stop four · the conversation
Starting the Exchange: Client-Server Communication
Once the TCP connection is established, the client and server can start exchanging messages using the HTTP protocol.
What is the HTTP Protocol?
Hypertext Transfer Protocol (HTTP) is the most widely used application layer protocol in the TCP/IP suite, but it’s considered insecure, leading to a shift towards HTTPS, which uses TLS on top of TCP for data encryption. You’ll find more details about this later.
The browser will start by sending an HTTP request message to the server, asking for a copy of the site in the form of an HTML file. HTTP protocol can transfer files like HTML, CSS, JS, SVG, and so on.
HTTP Request/Response
There are two types of HTTP messages. Requests are sent by the client to the server to trigger an action. Responses are sent from the server to the client as an answer to the previous request. Messages are plain text documents, structured in a precise way determined by the communication protocol, in this case, HTTP.
GET /blog/how-the-web-works.html HTTP/1.1
Host: www.exampleurl.com Connection: close Accept: text/html
(blank line)(empty for this GET)HTTP/1.1 200 OK
Date: Mon, 09 Nov 2026 10:00:00 GMTgeneral Server: nginxresponse Content-Type: text/htmlrepresentation Content-Length: 1534representation
(blank line)<!DOCTYPE html> <html lang="en"> …
Precise versionWhich headers are really required, and is HTTP always plain text?
In HTTP/1.1 the only header a request must carry is Host. Connections stay open by default so they can be reused for the next request; sending Connection: close asks the other side to close the connection after this response.
HTTP/1.1 messages are plain text, exactly as shown above. HTTP/2 and HTTP/3 carry the same request line, headers and body, but encode them as binary frames.
Status codes: the note that comes with the plate
The server will reply to the request with an HTTP response. Responses include information about the request status and may include the requested resource or data. When the request for a web page is approved by the server, the response will include a 200 OK message. Other existing HTTP response codes are:
The response will also contain a list of HTTP headers and the response body, including the corresponding HTML code for the requested page.
HTTPS
Hypertext Transfer Protocol Secure (HTTPS) is not a different protocol, but an extension of the HTTP. It is usually referred to as HTTP over Transport Layer Security (TLS). Let’s see what it exactly means.
HTTP is the protocol used for most communications between browsers and servers, but it lacks security. Any data sent over HTTP can potentially be visible to anyone on the network. This is especially risky when sensitive data is involved in the connection, such as login credentials, financial information, health information, and so on.
The main motivation behind HTTPS is to ensure data privacy, integrity, and identification:
Privacy
Data is only accessible to whom it is supposed to be.
Integrity
Data cannot be intercepted or modified by anyone in between.
Identification
Both sender and receiver can be identified as who they claim to be by a legitimate authority.
In HTTPS the communications are encrypted using the TLS protocol, which relies on asymmetric public key infrastructure. It combines two keys: one public and one private. The server shares its public key so the client can use it to encrypt messages that can only be decrypted by the server’s private key.
To establish an encrypted communication, the client and the server have to initiate another handshake. During the handshake, they agree on the TLS version to use and on how they will encrypt data and authenticate each other during the connection, a set of rules known as the cipher suite. This handshake or TLS negotiation starts once a TCP connection has been established. Step through it below or tap any step.
- 1Client hello: The browser sends a hello message that includes all supported TLS versions and cipher suites.
- 2Server Hello: The server responds with the chosen cipher suite and TLS version, along with its SSL certificate containing the server's public key.
- 3Authentication and Pre-Master Key: The client verifies the server’s SSL certificate with the corresponding trusted authority, then creates a pre-master key using the server's public key (previously shared in the certificate) and shares this pre-master key with the server.
- 4Pre-master key decryption: The pre-mastered key can only be decrypted using the server’s private key. If the server is able to decrypt it, the client and server can then agree on a shared master secret to use for the session.
- 5Client ChangeCipherSpec: The client creates a session key using the shared master secret and sends the server all previously exchanged records, this time encrypted with the session key.
- 6Server ChangeCipherSpec: If the server generates the correct session key, it will be able to decrypt the message and verify the received record. The server then sends a record to confirm that the client also has the correct keys.
- 7Secured connection established: The handshake is complete.
Precise versionWhat changed in TLS 1.3?
Most connections today use TLS 1.3. It no longer sends an RSA-encrypted pre-master key. Instead, both sides exchange Diffie-Hellman key shares in the two hello messages and compute the same secret independently, so the handshake needs one round trip instead of two. The certificate check and the switch to a shared session key work the same way as described above.
During the handshake · asymmetric
Two different keys: the public key locks, the private key unlocks. Used to agree on a secret safely.
After the handshake · symmetric
Both sides hold the same session key and use it to encrypt and decrypt everything that follows.
Once the handshake is completed, all the communication between the client and server is protected by symmetric encryption using the session key, and the browser can make the first HTTP GET request for the site.
Time to First Byte
Once the browser's request is approved, the server will send a 200 OK message along with the response headers and the contents requested. As it is a website, content is likely to be an HTML document.
When the first request is made from the client, the first packet that arrives as response marks the Time to First Byte (TTFB), which represents the time elapsed since the request was initiated and when the first chunk of data was received as a response. It will include the time taken for the DNS lookup, the TCP handshake to establish the connection, and the TLS handshake if the request is made over HTTPS.
5Stop five · inside the browser
From Data to Pixels: The Critical Rendering Path
The Critical Rendering Path (CRP) is a series of steps that the browser performs to transform the data received back from the server into pixels on the screen. It includes creating the Document Object Model (DOM) and CSS Object Model (CSSOM), the render tree and layout.
3C 21 44 4F 43 54 59 50 45 20 68 74 6D 6C 3E 0A 3C 68 74 6D 6C 20 6C 61 6E 67 3D 22 65 6E 22 3E 0A 3C 68 65 …decoded as UTF-8 text:
<!DOCTYPE html> <html lang="en"> <he…
html ├─ head │ ├─ meta ×2 │ └─ title └─ body ├─ main │ ├─ header › h1 │ └─ section › h2, p ×3, ul › li ×2 └─ footer › pThe DOM: every tag is now a node.
- bodyArial · bg #f4f4f9 · #333
- mainpadding 20px · max-width 800px
- headerbg #005bbb · white · centred
- h124px
- h2display: none
- pmargin-bottom 10px
- ulmargin-left 20px · disc
- footer14px · centred · #555
html └─ body ├─ main │ ├─ header › h1 │ └─ section › p ×3, ul › li ×2 └─ footer › p head, meta, title, h2 ← droppedThe render tree: visible nodes with computed styles.
- bodyx 8 · y 8 · 1008 px wide
- mainx 112 · 800 px wide
- headerx 132 · y 28 · 760 px wide
- sectionx 132 · 760 px wide
- footerx 8 · 1008 px wide
- fill the page background #f4f4f9
- fill the header box #005bbb
- draw the text: h1 in white, paragraphs in #333
- draw the list bullets
3C 21 44 is <!D.Building the DOM tree
When the first chunk of data arrives, the browser starts parsing the HTML. Parsing means analyzing and converting a piece of input code into a syntax and representation that can be interpreted by a specific runtime. In this case, the browser assembles the data packets received and parses the HTML, building a representation of the document as a node tree known as the DOM tree.
Each HTML tag in the document is represented as a node in the DOM tree. Nodes are connected to the DOM tree according to their hierarchical position in the document, and each node's representation includes all relevant information about the tag. For the following HTML code, the resulting DOM tree is on the right. Tap an element to fold its branch.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>What Really Happens When You Navigate to a Website</title> </head> <body> <main> <header> <h1>What Really Happens When You Navigate to a Website</h1> </header> <section> <h2>Intro</h2> <p> Before entering into the details of every step included in the process, let's review some of the basic concepts we will be discussing throughout the blog. </p> <p> The Internet is a huge network of interconnected computers. The World Wide Web (aka web) is built on top of that technology, as well as other services such as email, chat systems, or file sharing. </p> <p>Computers connected to the internet are either:</p> <ul> <li> <p>Clients, the web user's devices and the software that those devices use to access the web.</p> </li> <li> <p>Servers, computers that store web pages, sites, or apps and the files they need to be displayed in the user's web browser or devices.</p> </li> </ul> </section> </main> <footer> <p>© 2024</p> </footer> </body> </html>
-
-
- meta charset
- meta viewport
- “What Really Happens…”
-
-
- “What Really Happens…”
-
- “Intro”
- “Before entering into…”
- “The Internet is a huge…”
- “Computers connected…”
-
- “Clients, the web user's…”
- “Servers, computers that…”
- “© 2024”
-
-
The DOM tree includes all HTML elements, its content and its hierarchy relationships. Grey italic leaves are text nodes.
While parsing the HTML, the browser makes additional requests for encountered resources. CSS files and images are non-blocking resources, meaning the parser will continue its task while awaiting the requested resources. But if a <script> tag is found, the HTML parsing will pause impacting the time to first rendering.
<p>, <ul>…Becomes a DOM node.keeps parsing<link rel="stylesheet">CSS is requested in the background.keeps parsing<img>Image is requested in the background.keeps parsing<script>Script must be fetched and run first.⏸ parsing pausesBuilding the CSSOM Tree
While the DOM contains all the information about the content of the page and its hierarchy, the CSSOM contains the information on how to style the page. In the CSSOM, each HTML element is matched with its corresponding CSS styles. The result is a tree that doesn’t contain information about the content of the elements, but about how they should be displayed.
* { box-sizing: border-box; } body { font-family: Arial, sans-serif; background-color: #f4f4f9; color: #333; } main { padding: 20px; max-width: 800px; margin: 0 auto; } header { background-color: #005bbb; color: #ffffff; padding: 10px; text-align: center; } h1 { font-size: 24px; } section { margin-top: 20px; } h2 { font-size: 20px; color: #005bbb; display: none; } p { margin-bottom: 10px; } ul { margin-left: 20px; list-style-type: disc; } footer { margin-top: 40px; text-align: center; font-size: 14px; color: #555; }
- * (every element)box-sizing: border-box
- bodyfont-family: Arialbackground #f4f4f9color #333
- mainpadding: 20pxmax-width: 800pxmargin: 0 auto
- headerbackground #005bbbcolor #fffpadding: 10pxtext-align: center
- h1font-size: 24px
- sectionmargin-top: 20px
- h2font-size: 20pxcolor #005bbbdisplay: none
- pmargin-bottom: 10px
- ulmargin-left: 20pxlist-style-type: disc
- li
- pmargin-bottom: 10px
- li
- headerbackground #005bbbcolor #fffpadding: 10pxtext-align: center
- footermargin-top: 40pxtext-align: centerfont-size: 14pxcolor #555
- mainpadding: 20pxmax-width: 800pxmargin: 0 auto
- bodyfont-family: Arialbackground #f4f4f9color #333
The CSSOM tree includes each HTML element and their corresponding styles. Note the red display: none on h2: it decides that heading’s fate in the render tree.
Its creation is not incremental, meaning that the browser stops rendering the page until it processes all the CSS. This works this way because, as its name suggests, Cascading Style Sheets (CSS) apply styles from top to bottom, meaning that classes defined later override those at the beginning of the document. A CSS document needs to be fully processed before rendering anything on the screen, as there are classes that may change.
p { color: #333; }Computers connected to the internet…✗ grey: wrong, and about to changep { color: #005bbb; } /* later rule wins */Computers connected to the internet…✓ blue: the final styleJavascript Compilation and Execution
While the CSSOM is being created, rendering is blocked, but the browser continues downloading any JavaScript files it encounters.
JavaScript is also parsed, compiled, and interpreted by the browser, but as mentioned before, it is a parser-blocking resource by default. This means that when the browser encounters a <script> tag, it stops HTML parsing and executes the file before continuing. The async or defer attributes can be used to avoid this behavior, allowing parsing to continue while the resource is fetched. Compare the three below.
<script> tag. The file is downloaded and executed, and only then does parsing continue, so the page finishes parsing last.Once the browser completes parsing and executes all JavaScript files that may modify the DOM and CSSOM, the next step is to build the render tree. However, before seeing this step in detail, let’s take a moment to focus on the accessibility tree.
Building the Accessibility Tree
Based on the structure of the site created in the DOM tree, the browser also creates an accessibility tree. The accessibility tree is another representation of the site’s content, specifically designed to allow navigation through the site using assistive technologies.
At a museum
An audio guide describes each exhibit: what it is, what it’s called, and anything you can do with it, for visitors who can’t see the displays.
In the browser
The accessibility tree gives screen readers and other assistive technologies a role, a name and a state for every element they can reach.
In the accessibility tree, each DOM element is represented as an accessible object, containing the following information:
Name
An identifier used to refer to the element.
Description
Additional information about the element.
Role
The type of element it is, related to its intended use.
State and other properties
If the element is subject to change, it may include its current state. It can also include other properties specifying other functionality.
- Role
- list
- Name
- none
- Description
- none
- State / properties
- none (a static list has no changing state)
Having a well-structured accessibility tree is key in determining whether a site will be navigable using assistive technology, making the difference between inclusion and exclusion.
Render tree
After building the DOM, CSSOM, and accessibility trees, the browser builds the render tree. This tree is a combination of the DOM and CSSOM trees. The browser processes all nodes and keeps only the visible ones. Then, it combines them with their corresponding CSSOM rules. The result is a collection of all visible elements matched with their computed styles.
Non-visible nodes, such as <script> or <meta> tags, as well as elements hidden with the display: none CSS property, are not included in this tree.
- html
- headnever displayed
- metanon-visible
- metanon-visible
- titlenon-visible
- bodyArialbg #f4f4f9color #333
- mainpadding 20pxmax-width 800px
- headerbg #005bbbcolor #fffcenter
- h124pxcolor #fff (inherited)
- sectionmargin-top 20px
- h2display: none
- pmargin-bottom 10px
- pmargin-bottom 10px
- pmargin-bottom 10px
- ulmargin-left 20pxdisc
- li
- pmargin-bottom 10px
- li
- pmargin-bottom 10px
- footer14pxcentercolor #555
- pmargin-bottom 10px
Layout
Once the render tree is computed, the browser runs the layout. In this process, the browser calculates the exact position and size each element will take into the page.
These calculations are based on the viewport size, the browser area that will actually display the site content. The size of the viewport varies based on the device screen size, the browser window size, system settings along other conditions. Drag the slider to resize the viewport and watch the browser recompute the boxes for our example page.
main at this width · DevTools colours main has max-width: 800px and margin: 0 auto, so on wide viewports it stops at 800 px and centres; below about 816 px it fills the width minus the body’s default 8 px margins.The layout output is a box model that captures the size and position that correspond to each element and object present in the render tree. The browser starts processing the document usually from the <body> tag and going through all its descendants.
After the layout calculation, any changes in the size or position of one or more elements in the document will trigger new calculations. Those following calculations are called reflows.
Painting
Now, the final step is displaying the layout output on the user's screen. During the painting or rasterization phase, the browser converts each layout box element into corresponding pixels on the screen.
Many factors impact the time it takes for the browser to perform this step, and there are tools that help developers measure and optimize this time.
After painting, and before users can start interacting with the website, the browser may execute any JavaScript that has been deferred using the defer or async attributes to avoid blocking the initial HTML parsing.
A Note About JavaScript Hydration
The steps we described above show the process of rendering all the website’s HTML, CSS, and JavaScript code in the browser. This is known as Client-Side Rendering (CSR). You may have also heard about Server-Side Rendering (SSR).
SSR consists of rendering a website’s content on each request and delivering it to the client as HTML ready to be displayed in the browser.
When a site is rendered using CSR, all the JavaScript is executed before the page is rendered. In SSR, the server-rendered HTML loads and displays quickly in the browser, but JavaScript still needs to be sent to the client to enable user interaction.
JavaScript Hydration is the process where JavaScript is added to a server-rendered HTML page to make it interactive. Once the initial HTML is served and displayed in the browser, JavaScript “hydrates” the static content, attaching event listeners and enabling interactive functionality. Think of a furnished show home: everything is in place, but the switches only work once the electricity is connected. Try it:
What Really Happens When You Navigate to a Website
Computers connected to the internet are either clients or servers.
- // click “Like” before and after hydrating
Quick answers
Frequently asked questions
What happens when you type a URL into the browser?
The browser finds the IP address for the domain with a DNS lookup, checking its own cache and the operating system cache first. It then opens a TCP connection with a three-way handshake, adds a TLS handshake for HTTPS, and sends an HTTP GET request. The server answers with a response, usually an HTML document split into packets, and the browser turns the HTML, CSS and JavaScript into pixels through the critical rendering path.
What is DNS resolution?
DNS resolution matches a domain name to its IP address. The browser checks its cache, then the operating system cache, then asks a DNS resolver. If the resolver has no cached answer, it asks a root server, which points to the top-level domain (TLD) server, which points to the authoritative nameserver, which returns the IP address.
What is the TCP three-way handshake?
It is how a client and a server agree to start a TCP connection. The client sends SYN with a sequence number, the server replies SYN-ACK with its own sequence number and the client’s number plus one, and the client confirms with ACK. After these three messages the connection is established.
What is the difference between HTTP and HTTPS?
HTTPS is HTTP over Transport Layer Security (TLS). With plain HTTP, anyone on the network can potentially read the data. HTTPS encrypts it after a TLS handshake, which protects privacy and integrity and lets the browser verify the server’s identity through its certificate.
What is Time to First Byte (TTFB)?
TTFB is the time between the browser starting a request and receiving the first packet of the response. It includes the DNS lookup, the TCP handshake, the TLS handshake for HTTPS, and the time the server takes to start responding.
What is the critical rendering path?
It is the series of steps a browser performs to turn the HTML, CSS and JavaScript it receives into pixels: building the DOM tree and the CSSOM tree, combining them into the render tree, calculating the layout, and painting.
What is JavaScript hydration?
Hydration is the process where JavaScript is added to a server-rendered HTML page to make it interactive. The HTML is displayed first, then JavaScript attaches event listeners so buttons and other controls start working.
Wrapping up
Conclusion
Throughout this article, you enhanced your understanding of what happens from the moment you type a web address into your browser’s address bar until you access the content of the site you’re looking for.
You learned about URLs and the DNS lookup performed by the browser to find the site’s IP address. You also learned how connections are established between the browser and servers and how they communicate.
Finally, you explored what happens from the time the first chunk of data is received from the server until the site is displayed on your screen, along with key concepts such as the accessibility tree and the JavaScript hydration process.
I hope you enjoyed this guide and found it useful. Thanks for reading!
Example addresses use the reserved documentation range (203.0.113.0/24) and a placeholder domain. Timings in the TTFB diagram are illustrative.