TEZZ CONNECTBlog

Blog / Internet Technology & Updates / Web fundamentals

THE TEZZ CONNECT INTERNET EXPLAINER SERIES

How Does a Website Load? From DNS to Browser Rendering

You enter a web address, press Enter and a page appears. That familiar moment hides a remarkable chain of work: the browser interprets the address, finds the server, creates a connection, verifies security, requests a document, downloads supporting files and turns code into pixels. Understanding this journey makes slow-page diagnosis easier and helps explain why internet speed is only one part of website performance.

By Suraj Vishwakarma · Published by TEZZ CONNECT · Published 30 November 2026 · Updated 30 November 2026

Laptop displaying code on a desk
A browser combines network responses, code and media into an interactive page · Image source: Unsplash · Unsplash License

The short answer: a webpage is assembled in stages

A website is not usually one picture sent from a server. It is a collection of documents, stylesheets, scripts, fonts, images, video and other resources. The browser coordinates the retrieval of these resources and interprets them according to web standards. The server provides responses; the browser constructs the experience.

A typical navigation can involve these broad stages: the browser parses the URL; checks caches and existing connections; resolves the hostname through DNS if necessary; establishes a transport connection; negotiates TLS for HTTPS; sends an HTTP request; receives the response; parses HTML; discovers additional resources; builds document and style representations; calculates layout; paints pixels; and continues running scripts and handling user input.

These stages are not a rigid waterfall in which every step must finish before the next begins. Modern browsers stream data, discover resources while parsing, reuse connections, download assets in parallel and progressively render content. Some work happens concurrently. A page can show useful text while images are still downloading, and a browser can start fetching a stylesheet before it has received the complete HTML document.

It is useful to separate three questions. Can the browser reach the website? Can it receive the document and its resources? Can the device process those resources quickly enough to show a stable, usable page? A connection can be healthy while a page remains slow because its server is busy, its JavaScript is expensive or its images are enormous.

Step 1: the browser interprets the URL

A URL is a structured address, not just a name. Consider https://www.example.com/products/item?colour=blue. The scheme is HTTPS. The hostname is www.example.com. The path identifies a resource on that host, and the query string carries additional parameters. A URL can also include a port, credentials or a fragment, although credentials should not be embedded in ordinary links.

The scheme influences how the browser communicates. HTTP uses the Hypertext Transfer Protocol without TLS protection at the application connection layer. HTTPS uses HTTP over a secure transport protected by TLS. The hostname identifies the authority the browser intends to contact. The path and query are sent as part of the request target, subject to the protocol version.

The browser also applies rules for redirects, security policies, cookies, cache state and navigation history. If the address redirects from one URL to another, the browser follows the response according to redirect rules. A redirect can be useful when a site changes domains or moves a page, but unnecessary redirect chains add extra round trips.

Before reaching the network, the browser may find that it already has a suitable cached response or an open connection to the same origin. It may also use a service worker that intercepts requests for a site where one is installed and active. These mechanisms can change the path a request takes. A repeat visit can therefore be much faster than a first visit, even on the same connection.

Step 2: DNS finds network addresses for the hostname

Humans prefer names such as example.com. Internet routing uses IP addresses. The Domain Name System (DNS) provides the distributed naming system that lets a client discover records associated with a domain. When a browser needs an address for a hostname, it can use information already cached by the browser, operating system or a configured resolver. If no usable answer is available, a DNS query is sent.

A recursive resolver performs the lookup on the client's behalf. Depending on its cache and the domain's delegation, it may consult DNS infrastructure through root, top-level-domain and authoritative name servers. The authoritative server provides the records for the domain. A resolver can then return the answer to the client and cache it according to the record's time to live (TTL).

DNS answers are not always a single IPv4 address. A hostname may have A records for IPv4 and AAAA records for IPv6. It may use CNAME aliases, load-balancing answers, geographic routing or other DNS records. The browser and operating system can select from available addresses using network reachability and connection strategies. DNS does not itself carry the webpage; it helps the client locate an endpoint.

DNS caching is why a lookup does not necessarily occur for every visit. A cached record can be reused until its TTL expires, and browsers may also retain connections to an address. Conversely, changing a DNS record does not guarantee every user sees the change instantly: old cached answers can remain valid until their TTL expires. DNS propagation is often a shorthand for this distributed caching and update process, not a single global switch.

DNS can also be encrypted between a device and its resolver using technologies such as DNS over HTTPS (DoH) or DNS over TLS (DoT). These protect the DNS exchange on that segment, but they do not make every part of browsing anonymous. The destination service, network metadata and other signals can still reveal information. DNSSEC addresses a different problem: it helps validate the authenticity and integrity of DNS data rather than encrypting the query.

Step 3: the browser establishes a connection

Once it has a destination address, the browser needs a transport path. Many HTTPS connections use TCP, the Transmission Control Protocol. TCP establishes a connection with a handshake, maintains ordered delivery, retransmits lost data and provides congestion control. The classic TCP handshake exchanges SYN, SYN-ACK and ACK segments. It establishes the transport connection, not the identity of the website and not the encryption.

Modern web traffic can also use QUIC, a transport protocol built on UDP and used by HTTP/3. QUIC integrates secure connection establishment, stream multiplexing and transport features. It can reduce some connection setup costs and avoid the TCP-level head-of-line blocking that affects multiple streams sharing a TCP connection. Whether HTTP/3 is used depends on server support, client support and network conditions.

Network distance matters. A request travelling from a phone in Mumbai to a server in another continent may experience more round-trip time than one served from a nearby edge location. Congestion, wireless retransmissions, routing choices, peering and the quality of the access network can all add delay. The physical path is not necessarily the geographically shortest route.

Connection reuse is a major optimisation. If the browser already has a suitable connection to the same origin, it may send another request over that connection instead of starting a new one. HTTP/2 supports multiple concurrent streams over one connection. HTTP/3 also multiplexes streams, with transport behaviour designed to isolate packet loss between streams more effectively. Reuse reduces repeated setup work.

Step 4: TLS protects an HTTPS connection

For HTTPS, the client and server establish TLS security. TLS is designed to provide confidentiality, integrity and authentication. In a typical web visit, the server presents a digital certificate. The browser checks whether the certificate is valid for the hostname, whether it is within its validity period and whether it chains to a trusted certificate authority. It also checks relevant constraints and revocation-related information according to browser policy.

The TLS handshake negotiates protocol parameters and cryptographic keys. Once established, application data is encrypted and authenticated. A person observing the network should not be able to read or silently alter the protected HTTP content in transit. The certificate helps the browser verify that it is communicating with a server authorised for the requested hostname.

TLS does not prove that a website is honest, safe or free from scams. A phishing site can obtain a valid certificate for its own domain. HTTPS protects the connection to the site named in the address bar; it does not certify the site's business practices or the accuracy of its content. Users should still check the domain, evaluate requests for sensitive information and use trusted payment channels.

Modern TLS versions and connection resumption reduce the cost of secure connections. Browsers can reuse a TLS connection for multiple requests to the same origin and may resume sessions in later connections. This means HTTPS is not automatically a major speed penalty. Server configuration, latency, connection reuse and page design often matter more than the cryptographic operations themselves.

Step 5: HTTP carries the request and response

HTTP is the application protocol used to request and transfer web resources. The browser sends a request that includes a method, target and headers. A GET request typically asks for a resource. A POST request commonly submits data for processing. Other methods include HEAD, PUT, PATCH, DELETE and OPTIONS, each with defined semantics.

Headers communicate metadata. They can describe accepted formats, compression, language preferences, cookies, cache directives, content type, authentication and more. The server responds with a status code, response headers and usually a body. A 200 status generally indicates success; 301 and 308 indicate permanent redirects; 302 and 307 indicate temporary redirects; 404 means the resource was not found; and 500 indicates an internal server error.

HTTP versions differ in how messages are framed and transported. HTTP/1.1 commonly uses persistent connections. HTTP/2 introduces binary framing and multiplexed streams over a connection. HTTP/3 maps HTTP semantics onto QUIC. These versions do not change the basic idea that the browser requests a resource and the server responds, but they change how requests can be efficiently carried across the network.

Compression can reduce the number of bytes transferred. Text-based assets such as HTML, CSS, JavaScript and JSON often compress well with Brotli or gzip. Images and video usually use their own compression formats. A server can also use cache headers so that a browser stores a resource and reuses it later, or validates whether a cached copy remains current.

Step 6: a CDN or edge network may serve the response

Many websites use a content delivery network (CDN), reverse proxy or edge platform between the visitor and the origin server. A CDN operates distributed infrastructure that can cache eligible content closer to users. If a requested asset is available in a nearby cache, the edge can return it without fetching it from the origin on every request.

Cache behaviour depends on the URL, request headers, cookies, cache rules, freshness lifetime and the site's configuration. Public static assets such as versioned images, CSS and JavaScript are often good cache candidates. Personalised account pages and private responses require more careful handling because serving one user's content to another would be a serious privacy failure.

A cache miss may cause the edge to contact the origin server. The edge can still provide benefits such as connection management, compression, routing, security filtering and shielding the origin from some traffic. Some platforms execute application logic at the edge. Others primarily proxy requests to a separate application or hosting environment.

A CDN cannot magically fix every performance problem. If the origin generates a page slowly, the edge may still have to wait. If every request is personalised and cannot be cached, the response may need to travel to the origin. If the page downloads many large third-party scripts, a fast CDN for the main HTML does not remove the cost of those external resources.

Step 7: the server creates or retrieves the HTML

The origin server receives the request and decides what response to send. For a static website, it may retrieve a prebuilt HTML file from storage. For a dynamic application, it may run code, read a database, call internal services, check authentication and generate HTML or JSON. A server-side rendered page can contain meaningful content before client-side JavaScript has started.

Server response time depends on many factors: application code, database query efficiency, cache hits, CPU availability, storage, upstream APIs and traffic load. A server can be close to the user and still respond slowly if it is overloaded or waiting for a slow database. A geographically distant server can respond quickly if its content is cached at an edge location.

Streaming responses allow a server to begin sending data before it has generated every byte. The browser can start parsing received HTML while more bytes are still arriving. This overlap can improve perceived speed. However, streaming only helps when the first useful content is produced early and the browser has the resources needed to render it.

Servers also communicate caching instructions. Cache-Control can indicate whether a response is public or private, how long it can be stored and whether it must be revalidated. ETags and Last-Modified headers can support conditional requests. If the resource has not changed, the server may return 304 Not Modified, allowing the browser to reuse its cached body.

Step 8: the browser parses HTML into the DOM

When HTML bytes arrive, the browser decodes them and runs the HTML parser. The parser turns markup into tokens and constructs a Document Object Model, or DOM. The DOM is a structured representation of elements, attributes and text. It allows scripts and browser features to inspect and modify document content.

DOM construction is incremental. The browser does not need to wait for the entire document before building the first part of the tree. As it encounters references to stylesheets, scripts, images and other resources, it can schedule additional requests. Resource discovery is one reason the order and placement of elements in HTML can affect performance.

Some scripts can pause the parser while they are fetched and executed because they may use document.write or modify the document in ways that affect parsing. The async and defer attributes change how external scripts are loaded and executed. A deferred script downloads while parsing continues and runs after parsing completes, in document order. An async script runs when it is ready, without preserving order relative to other async scripts.

HTML semantics also matter beyond visual layout. Headings, links, buttons, labels, landmarks and form controls communicate structure and purpose to assistive technologies. The browser builds accessibility information alongside its document representation. Good semantic HTML improves usability, keyboard navigation and the ability of assistive tools to interpret a page.

Step 9: CSS is parsed into the CSSOM

CSS describes how document elements should look and be laid out. The browser parses CSS rules and builds a CSS Object Model (CSSOM), representing styling information. It resolves selectors, inheritance, cascade layers, specificity, custom properties, media queries and other rules to determine the computed style for elements.

Stylesheets can block the first render because the browser needs enough style information to avoid displaying an incorrectly styled page. CSS can also affect JavaScript execution: a script that asks for computed style or layout information may need the browser to process pending styles first. Large stylesheets, expensive selectors and unnecessary style recalculation can contribute to rendering work.

Responsive design uses media queries and flexible layout systems to adapt to different viewports. A mobile browser may select different CSS rules, image sources or layout arrangements from a desktop browser. The viewport meta element helps pages use the device's actual CSS viewport width instead of a scaled desktop layout.

Not every CSS file needs to block every viewport. Developers can separate critical styles from less important styles and use media attributes for stylesheets that apply only in specific conditions. The goal is not to remove styling but to make the first visible layout available without forcing the browser to wait for unrelated assets.

Step 10: JavaScript adds behaviour—and can add work

JavaScript powers interactive features such as menus, forms, search, dashboards and dynamic content. The browser downloads scripts, parses and compiles them, then executes code on one or more threads according to browser architecture. JavaScript can modify the DOM, update CSS classes, fetch data and respond to events.

Heavy JavaScript can delay interaction even after the page appears. Long tasks on the main thread can prevent the browser from responding promptly to taps, clicks and keyboard input. Large frameworks, analytics tags, advertising scripts, chat widgets and multiple third-party libraries can all contribute. The total cost includes download, parse, compile, execute and memory usage.

Code splitting can load only the JavaScript needed for the current page or feature. Lazy loading can defer non-critical work until it is needed. Developers can use web workers for suitable background computation, although workers cannot directly manipulate the page DOM. Event handlers should avoid repeated expensive calculations and unnecessary layout reads.

JavaScript should enhance a usable document rather than be the only way to expose essential information. Server-rendered or static HTML can make core content discoverable and readable before client-side code completes. Progressive enhancement allows basic navigation and content to remain available even when optional scripts fail or are delayed.

Step 11: the browser builds a render tree and calculates layout

The browser combines document structure with computed styles to determine which elements are visible and how they should appear. This produces the information needed for rendering. The layout stage calculates the size and position of boxes, text, images and other visible elements within the viewport and document flow.

Layout is affected by the viewport size, fonts, content, CSS rules and intrinsic dimensions of replaced elements such as images. If an image's dimensions are unknown when the first layout occurs, the browser may need to recalculate layout when the image arrives. Reserving width and height or an aspect ratio helps the browser allocate space and reduces unexpected movement.

Changes to layout-affecting properties can trigger reflow. If JavaScript repeatedly reads layout values and then writes style changes in a loop, it can force synchronous layout work. This pattern is sometimes called layout thrashing. Batching reads and writes, using transforms for suitable animations and avoiding unnecessary DOM changes can reduce the work.

Content that is hidden with display:none is generally excluded from the render tree, while visibility:hidden content can still occupy layout space. The browser also handles fixed, sticky and positioned elements, stacking contexts, overflow and writing modes. Real layout is sophisticated because web pages must adapt to different screen sizes, languages, fonts and user preferences.

Step 12: paint, rasterisation and compositing put pixels on screen

After layout, the browser paints visual details such as text, backgrounds, borders, shadows and images. Paint operations are represented in display lists or similar internal structures. Rasterisation converts drawing instructions into pixels or texture tiles. A compositor can combine layers and present the final frame to the display.

Browsers may promote some content to composited layers so that scrolling or certain animations can update without repainting the entire page. This is not a reason to add will-change or transforms to every element. Too many layers consume memory and can make performance worse. Browser engines make layer decisions based on the page and their own heuristics.

Animation performance depends on what changes. Animating properties such as transform and opacity can often be handled more efficiently than repeatedly changing width, height, top or left, which may require layout. However, actual performance depends on the browser, hardware, page complexity and animation. Measurement on representative devices is more useful than assuming a property is always cheap.

The first visible frame is not the end of loading. Images may still decode, fonts may swap, scripts may hydrate server-rendered markup, and data requests may update the page. A site should aim for a stable, useful initial view and then progressively enhance it without unexpected shifts or blocking the user's first interaction.

Why a page can feel slow even with fast internet

Internet speed tests usually estimate throughput, latency and sometimes jitter or packet loss between a device and a test endpoint. A webpage uses many requests to different servers and requires browser processing. High download throughput helps transfer large resources, but it does not guarantee low DNS delay, quick server processing, efficient JavaScript or fast image decoding.

Latency matters for request chains. If a page requires many sequential round trips before it can show meaningful content, even a fast connection can feel slow. A page that makes many small requests to distant third-party services may be more affected by latency than a page that transfers a larger but well-compressed bundle from a nearby edge.

Large images are a common problem. A page may download a multi-megabyte image even when a small thumbnail is displayed. Responsive image markup, modern formats, compression and correct sizing can reduce bytes. Lazy loading below-the-fold images avoids competing with the content needed for the initial viewport. The main hero image should be prioritised carefully rather than lazy-loaded indiscriminately.

Third-party code can introduce delays outside the site's direct control. Analytics, advertising, social embeds, maps, video players and chat services can create extra DNS lookups, connections, scripts and long tasks. Each integration should have a clear purpose. Loading every optional widget immediately can make the first interaction slower and increase privacy exposure.

How to diagnose a slow website in the browser

Start with a repeatable test. Use the same device, browser, page and network. Record whether the visit is a first load or repeat load. Try a private window only when you specifically want to reduce the influence of existing browser cache, cookies and extensions; it does not create a perfect clean-room network test. Compare another site to see whether the issue is general or limited to one origin.

Browser developer tools provide a Network panel that shows requests, status codes, transferred bytes, cache behaviour and timing. The timing breakdown can help separate DNS lookup, connection setup, TLS negotiation, waiting for the first byte and content download. A long waiting period before the first byte can point to server or upstream processing, while a long download can point to resource size or throughput.

The Performance panel records main-thread activity, rendering, scripting and layout. Look for long tasks, repeated style recalculation, forced layout, large script evaluation and expensive rendering. The browser's console can expose failed requests, JavaScript errors, certificate warnings and content security policy problems.

Core Web Vitals provide user-centred measurements for loading, interactivity and visual stability. Largest Contentful Paint (LCP) measures when the largest visible content element is rendered. Interaction to Next Paint (INP) measures interaction responsiveness across a page visit. Cumulative Layout Shift (CLS) measures unexpected visual movement. These metrics help identify experience problems that a raw speed-test number cannot describe.

Test more than one device class. A page that feels instant on a powerful desktop can struggle on a low-cost phone with limited CPU, memory or storage. Mobile networks can have variable latency and radio conditions. A realistic performance budget should consider the users and devices the site actually serves, not only a developer's laptop and office connection.

Practical improvements for website owners

Send useful HTML early. Server-side rendering, static generation or carefully designed streaming can expose content before large client-side bundles finish. Keep the first response small enough to parse quickly, but do not remove meaningful content merely to chase a synthetic score. A readable page with clear headings and working links is a strong baseline.

Optimise critical assets. Minify and compress CSS, JavaScript and HTML. Remove unused code. Split bundles by route or feature. Preload only genuinely critical resources, such as a key font or hero image, and avoid speculative preloads that compete with more important requests. Use font-display strategies and sensible fallbacks to reduce invisible text.

Set appropriate caching. Version static filenames when their contents change, then give those assets long-lived cache lifetimes. Use shorter or revalidated policies for HTML that changes more often. Ensure private or personalised responses are not accidentally shared by a public cache. Monitor cache hit ratios and verify behaviour with real request headers.

Reduce layout shifts. Include image dimensions or aspect ratios, reserve space for ads and embeds, avoid inserting banners above existing content after load, and use stable font metrics where possible. A page that jumps while a user is about to tap a link feels broken even if all resources technically loaded quickly.

Measure after every meaningful change. Use browser tools, field data and controlled lab tests. A faster score is useful only if the page remains accessible, secure and correct. Check keyboard navigation, screen-reader structure, reduced-motion preferences and slow network behaviour alongside performance metrics.

What happens after the first page appears?

Modern sites continue working after the initial render. A single-page application may fetch API data, update components and change the URL without a full document navigation. A service worker may cache resources or provide an offline fallback. WebSockets or server-sent events can keep data updated. Background tasks can prefetch likely next pages or synchronise information when connectivity returns.

These capabilities can make a site feel responsive, but they also add complexity. A service worker can serve stale content if its cache update strategy is poorly designed. A background sync may fail when the device is offline or the browser restricts background activity. A WebSocket can disconnect when a phone changes networks or enters a power-saving state. Good applications handle these conditions explicitly.

Navigation is therefore a lifecycle, not a single event. The browser may restore a page from its back-forward cache, reuse resources from disk or memory, refresh stale content, or perform a new network request. The visible result depends on browser policy, page code, headers and device state. This is why two visits to the same URL can have very different timing profiles.

Frequently asked questions

1. What happens when I type a URL into a browser?

The browser interprets the URL, checks available cached information, resolves the hostname when needed, establishes a connection, negotiates security for HTTPS, sends an HTTP request, receives a response and processes HTML, CSS, JavaScript and other resources to render the page.

2. Does DNS happen every time I open a website?

No. Browsers, operating systems and DNS resolvers can cache DNS answers for their time to live. A cached answer may be reused until it expires or is cleared, although a new connection or request may still be required.

3. What is the difference between DNS, TCP and TLS?

DNS maps a hostname to network information such as IP addresses. TCP provides a reliable ordered byte stream for applications that use it. TLS protects a connection with encryption, authentication and integrity. They perform different jobs in a typical HTTPS-over-TCP connection.

4. Does HTTPS make a website load slower?

HTTPS adds security negotiation and cryptographic work, but modern TLS, connection reuse, HTTP/2 and HTTP/3 reduce overhead. The effect on real page speed depends on network latency, server configuration, caching and page resources.

5. What does a CDN do when a website loads?

A content delivery network serves cached or dynamically routed content from distributed locations closer to users, when possible. It can reduce distance to content, protect the origin and improve availability, but not every request is necessarily served from cache.

6. What are DOM and CSSOM?

The DOM is the browser's tree-like representation of HTML document structure. The CSSOM represents parsed CSS rules and styling information. The browser uses these and other data to calculate styles and render visible content.

7. Why can JavaScript delay a webpage?

Some scripts block HTML parsing or occupy the main thread while they download, compile or execute. Scripts can also change the DOM and trigger style recalculation or layout. Using appropriate loading strategies and limiting unnecessary work can improve responsiveness.

8. What is the difference between loading and rendering?

Loading generally describes retrieving the document and its resources over the network. Rendering describes turning document structure, styles and assets into pixels and interactive content on the screen. These activities overlap because browsers process data incrementally.

9. Why does a page sometimes show text before images?

Browsers can parse and render HTML text while image files are still downloading or decoding. Image priority, size, cache state, connection conditions and layout dependencies affect when each image appears.

10. How can I tell whether a slow website is a network or browser problem?

Compare DNS, connection, TLS, waiting for the first response byte, download and rendering timings in browser developer tools. Test another site and network, inspect device CPU and memory use, and compare a simple page with a resource-heavy one before deciding where the delay occurs.

Technical references and further reading

Related reading: DNS security and DNSSEC · TLS, HTTPS and certificates · HTTP/3 and QUIC · How CDNs work