Blog / How the internet works /
How a website really loads: from server to screen
You type an address, press enter, and a page appears. Usually in about a second or two. It feels like nothing happened. In fact, dozens of small steps took place, across several computers, sometimes on different continents.
If you run a website, those steps are where speed is won and lost. If you simply use the web, they explain why some sites open instantly and others make you stare at a blank screen.
This is the whole journey of one page load, in order, with a plain-words explanation of each step and what can go wrong. By the end you’ll know where to look when someone says “the site is slow”.
The short version
- Your browser works out where the site lives (DNS).
- It connects to the server and sets up a secure channel (TCP, TLS).
- It asks for the page (an HTTP request).
- The server builds and sends the page.
- The browser reads the page and asks for everything else: styles, scripts, images, fonts.
- It works out the layout and paints the screen.
- Scripts make the page interactive.
Every step takes time. Add them up and you get the loading time.
A picture to hold in your head
Imagine ordering food from a restaurant you have never visited.
- You look up the address (DNS).
- You travel there and greet the host (connection and security).
- You place the order (the request).
- The kitchen cooks (the server builds the page).
- The meal arrives in courses: the main dish first, side plates after (HTML first, then CSS, images and scripts).
- You sit and eat (the browser draws the page).
A slow meal can be down to a long journey, a busy kitchen or too many courses. A slow page is the same.
Step 1: finding the address (DNS)
Computers do not use names like example.com. They use numeric addresses called IP addresses. The Domain Name System, DNS, is the phone book that turns names into numbers.
When you type a name, your browser first checks its own memory, then your device, then asks a DNS resolver, usually run by your internet provider or a public service. If the resolver does not know, it asks a chain of other servers until it finds the answer, then remembers it for a while.
What can go wrong: a slow or overloaded DNS provider adds delay before anything else begins. Wrong records send visitors to the wrong place or nowhere. Changes can take time to spread because of caching, which I explain in TTL: why DNS changes take time. If DNS is new to you, start with DNS explained for people who just want their site to work.
What helps: a fast, reliable DNS host, and sensible record settings.
Step 2: connecting to the server
Once the browser has an IP address, it must open a connection. Under the hood this involves a short exchange of messages, a “handshake”, to agree how to talk.
Distance matters here. Messages travel at a very high speed, but not instantly, and every round trip counts. A visitor in Lagos connecting to a server in a different continent will wait longer than one connecting to a server close by. That delay is called latency. I explored what this means for African readers in hosting a WordPress site in Africa.
What helps: a server near your visitors, or a CDN, which keeps copies of your files in many locations. More on that in HTTP/2, HTTP/3 and CDNs: what site owners need to know.
Step 3: making it secure (HTTPS and TLS)
If the address starts with https, the browser and the server also agree how to encrypt their conversation. That is TLS. The server shows a certificate, which is like an ID card issued by a trusted authority, proving it is really the site it claims to be. The padlock in the address bar comes from this.
It adds a small amount of work, but modern setups make it quick, and browsers now expect it.
What can go wrong: an expired or misconfigured certificate produces a full-page warning that scares visitors away. My fix list for SSL certificates and HTTPS issues covers the usual suspects.
Step 4: asking for the page
Now the browser sends an HTTP request: “Please send me the page at this path.” It includes details such as which language it prefers, what kind of device it is and any cookies it holds for this site.
Step 5: the server builds the page
This is the kitchen. What happens depends on how the site is built.
A static site is like food already prepared. The server hands over a ready-made file. It’s very fast.
A dynamic site such as WordPress builds the page on the spot. The server runs code, asks a database for posts, products and settings, applies the theme and assembles the HTML. If the site is busy or the code is heavy, the kitchen gets slow.
Caching helps. Instead of cooking the same dish again for every visitor, the server (or a layer in front of it) keeps a finished copy and serves that.
The time from the request until the first piece of data comes back is often called TTFB, time to first byte. I explain what is slow and what is fine in server response time: what counts as slow.
What can go wrong: cheap crowded hosting, no caching, too many plugins, an overloaded database, big uncompressed responses.
What helps: page caching, a better host, fewer and lighter plugins, and a database that is not groaning under old data.
Step 6: the browser reads the HTML and asks for more
The server’s first response is the HTML, the page’s skeleton. As the browser reads it from top to bottom, it discovers other things it needs:
- CSS files that control how it looks.
- JavaScript files that add behaviour.
- Images, videos and fonts.
- Third-party items, such as analytics, chat widgets, ads and embedded maps, each of which needs its own DNS lookup, connection and download.
Each of these is another request, though modern connections handle many at once. Some resources block the page from appearing until they’re done. CSS is the main one: the browser will not draw the page until it knows what it should look like. Scripts can pause things too, unless they are marked to wait.
This is why a page with a hundred files and ten third-party scripts feels slower than a plain page, even if the main HTML arrived quickly.
What can go wrong: huge images, lots of render-blocking files, slow third-party services, fonts that hold up the text.
What helps: compressing and resizing images, loading below-the-fold images lazily, trimming unused scripts, delaying third-party tools, and hosting fonts efficiently. See self-hosting fonts and speeding up Google Fonts.
Step 7: rendering, or turning code into pixels
With the HTML and CSS in hand, the browser builds an internal map of the page, works out where everything goes, then paints it onto the screen. In steps:
- It builds the DOM, a tree of the page’s elements.
- It builds the style rules from the CSS.
- It does layout: sizes and positions of everything.
- It paints colours, text and images.
- It composites layers together, which matters for smooth scrolling and animation.
Two moments here matter to visitors:
- First paint: something finally appears.
- Largest contentful paint (LCP): the main part of the page, often a big image or headline, is visible.
If an image has no stated size, the page jumps around when it arrives. That jump is what Core Web Vitals call layout shift.
Step 8: JavaScript makes it interactive
Last, scripts run. They power menus, forms, carts, sliders and trackers. If a lot of JavaScript has to be downloaded and run, the page may look ready but ignore taps for a moment. That frustrating delay is what the responsiveness measure INP tries to capture, which I discuss in INP is now a Core Web Vital: what to fix first.
On a modest phone, JavaScript costs more than on a fast laptop. Plenty of your visitors are on mid-range devices and mobile data, so what feels fine on your machine may not feel fine on theirs.
Where the time goes: a quick map
| Stage | What is happening | Common slowdowns | Typical fixes |
|---|---|---|---|
| DNS | Find the server’s address | Slow DNS host | Reliable DNS provider |
| Connection | Open a link, set up security | Distance, slow handshake | Nearby server or CDN, modern protocols |
| Server | Build the page | Heavy code, slow database, no cache | Caching, better hosting, fewer plugins |
| Download | Send HTML and files | Big files, no compression | Compress, resize, minify |
| Render | Work out layout, paint | Blocking CSS and scripts | Trim, defer, inline critical styles |
| Interaction | Run scripts | Heavy JavaScript | Remove unused code, delay extras |
Caching: the shortcut on every step
Caching means keeping a copy of something so you do not have to fetch or build it again. It happens at several levels:
- In the browser, so returning visitors do not re-download your logo and styles.
- On a CDN, so files come from a nearby location.
- On the server, so pages are not rebuilt for every request.
- In DNS, so the address lookup is remembered.
Most “make my site faster” advice is some form of caching or sending less data. The cost of caching is the risk of showing old content, so you need a way to clear it when you update something.
How to find out where your site is slow
You don’t have to guess. Use the tools that show the steps.
- Browser developer tools. Open the Network tab, reload the page and watch the waterfall: each request as a bar on a timeline. Long early bars point to DNS, connection or server delay. Many long bars later point to heavy files.
- PageSpeed Insights. Gives lab results and, where there is enough traffic, real-user data from Chrome. It also lists suggestions.
- Your host’s tools. Some show server response times and resource use.
- Test from where your visitors are, not just from your own desk. A site that loads quickly in London can be slower in Lagos.
Then work from the top down: if the server is slow, fixing image sizes will not save you; if the server is quick but the page is heavy, upgrading hosting won’t either. I go through the order of attack in page speed on a budget: what to fix first.
Common myths
“A fast site means a fast host.” Hosting matters, but a fast host can still serve a bloated page.
“A perfect speed score means a fast site.” Scores are a guide. A real visitor on a slow connection is the true test.
“Images are always the problem.” Often, but not always. Scripts, fonts and server delay cause plenty of slowness.
“A CDN fixes everything.” It helps with distance and static files. It doesn’t repair a slow database or a script-heavy page.
“Mobile and desktop load the same way.” The steps are identical, but phones have weaker processors and often slower networks, so the same page costs them more.
What it means for you
If you are a normal visitor, now you know why a page sometimes hangs: it could be your connection, a far-off server, or a page asking for too much. Switching from Wi-Fi to mobile data, or the other way, is a quick test.
If you run a site, treat speed as a chain. The slowest link sets the pace. Measure first, find the stage that costs the most, fix that, and measure again. Small, ordered changes beat a random pile of plugins.
Key takeaways
- A page load is a chain: DNS, connection, security, request, server work, download, rendering and scripts.
- Distance, a slow server and heavy files are the three biggest causes of slowness.
- Caching and sending less data are behind most speed improvements.
- Use the Network tab and PageSpeed Insights to find which stage is slow before fixing anything.
- Test from where your visitors really are, on the devices they really use.
FAQ
Why does the same site load faster the second time? Your browser keeps copies of files, and DNS and connections may already be warm.
Does HTTPS slow a site down? The cost is small, and modern protocols make secure connections quick. Skipping HTTPS isn’t an option anyway, because browsers warn visitors.
What matters most for search? Speed is one signal among many. A page that is quick and stable is better for visitors, and that is the part worth chasing.
How fast should a page load? There is no single magic number. Aim for the main content appearing quickly on an ordinary phone and a normal connection, and for the page to respond when tapped.
Related reading
- Video on websites without slowing them down
- Caching explained: browser, server and CDN
- Why websites go down: the most common causes
Next time a site feels slow for you, which step do you think is to blame, and how would you check?