How the Web Works

Type an address, press Enter, and about a second later a page appears. In that second your browser has looked up an address, sent a request, received files and turned them into the page you see. You don't need to write code for this to matter. Knowing the chain lets you describe a problem precisely and ask a developer the right question, and it explains why a site is slow or down.
We'll follow the trip from address bar to finished page, then look at what browsers, servers and hosting each do, and end with how an application's front end and back end divide the work and talk to each other. By the end you'll be able to sketch how any website works.
What happens when you open a page (DNS, HTTP, request and response)
How the Web Works

Names for people, numbers for machines
Emma is a marketing coordinator at a charity in Manchester. She types the charity's web address into her browser, waits, and gets nothing. Her instinct is to message the developer with "the website is broken". If she knew the steps behind a page load, she could say which one failed.
On the internet, computers find each other by IP address, a number such as 192.0.2.172, but people prefer names. The Domain Name System (DNS) bridges the two and works as the internet's address book: when you enter a domain name, your browser asks a DNS resolver which IP address belongs to it.
What the browser asks for, and what comes back
Once it has the IP address, the browser connects to the server and sends an HTTP request. That request carries a method (GET to read something, POST to send data), a path and a few headers. The server answers with a status code, headers and a body, usually HTML.
Under the HTTP standard, status codes fall into five classes. 1xx is informational, 2xx means success, 3xx is a redirection, 4xx a client error and 5xx a server error. A 404 means nothing exists at that path; a 500 means the server failed.
- First the browser reads the address and looks in its cache.
- DNS converts the domain name into an IP address.
- Next the browser connects to the server, sets up a secure HTTPS connection and sends the HTTP request.
- Back comes a status code, along with the HTML.
- Finally the browser fetches the images, styles and scripts and draws the page.
Emma times a slow page
On a page that loads slowly, Emma opens her browser's developer tools and looks at the Network tab. The DNS lookup took 30 milliseconds and the connection 50. Then the server took 900 milliseconds to start replying, and the download took 120. Add them up (30 + 50 + 900 + 120) and the total is 1,100 milliseconds, of which the server accounts for 900, about 82 per cent. Now she can tell the developer that the delay is on the server, and that DNS and her Wi-Fi are fine.
The habit to break is calling every failure "the site is down". A DNS error is one problem. A 404 on a single page is another, a 500 from the server is a third, and each has a different owner. Before you report anything, write down the exact message and the status code.
Real case: Meta
Facebook, Instagram and WhatsApp were unreachable for nearly six hours on 4 October 2021. According to Meta, a maintenance command took down its backbone network, after which its DNS servers withdrew the routes that told the rest of the internet where to find them. Apps kept retrying, and Cloudflare reported that DNS resolvers worldwide were handling about 30 times their usual number of queries. Because DNS had failed, everything behind it looked broken too.
Practical takeaway
When a page fails, pin the failure to one step: the lookup, the connection, the request or the response. The status code and your browser's Network tab (in the developer tools) usually show you which.
Browsers, servers and hosting
How the Web Works

The browser's side of the job
Chrome, Firefox, Safari and Edge are all clients. A client sends requests, receives files and turns them into a page. The browser parses the HTML into a tree of elements called the DOM. It applies CSS to style that tree and runs JavaScript, which is allowed to change it. Only then does it lay the page out and paint it on screen. It also builds an accessibility tree for screen readers. The same files can look slightly different from one browser to the next, and that's why developers test in more than one.
Servers, and where they live
A server is a computer that waits for requests and answers them. Software on it listens for HTTP requests and sends back files, or pages it generates on the spot. Hosting is about where that server lives and who looks after it, and there are four main options:
- Static hosting serves fixed files such as HTML, CSS and images, and leaves you little to maintain.
- With managed hosting a provider runs the server for you, which is common for WordPress sites.
- On cloud platforms such as AWS, Microsoft Azure and Google Cloud you rent computing power and scale it up or down.
- A content delivery network (CDN) keeps copies of your files on servers around the world, so each visitor downloads from one nearby.
Plenty of organisations mix them. A company might keep its marketing site on static hosting and run its customer portal on a cloud platform, with a CDN in front of both. Which you choose depends on how often the site changes, how many people use it and who in the team can maintain it.
Daniel's heavy tracking page
Word reaches Daniel that customers in Australia find the tracking page slow. He's an operations analyst at a logistics firm in Toronto. The page weighs 3 MB, mostly large photos. At 20,000 visits a month the server is sending 3 x 20,000 = 60,000 MB, about 60 GB, every month. Once he compresses the images the page drops to 1.2 MB, so 1.2 x 20,000 = 24,000 MB, or 24 GB. That's 60 per cent less data. And serving the images from a CDN means a visitor in Sydney downloads them from a nearby server instead of one in Canada.
A bigger server won't fix every slow page. Often the server has replied quickly, and it's the browser that then spends seconds downloading heavy images and scripts. So check what the browser is waiting for before you add server power.
Practical takeaway
Hold three questions apart: what the browser does, what the server does, and where the server lives. Most speed and reliability problems sit clearly under one of them. Name the right one and the right person starts working on it.
Front end, back end and how they talk
How the Web Works

Front end and back end
Everything that runs in the browser is the front end: the HTML structure, the CSS styling and the JavaScript that reacts to clicks. The back end runs on the server, where it checks who you are, applies the business rules, reads from and writes to the database, and sends results back. A simple brochure site can be all front end, but most of the tools you use at work (a booking system, say, or an expenses app) need both. In job adverts you'll see front-end developers, back-end developers, and full-stack developers, who work across both halves.
APIs and JSON: how the two halves talk
When the front end needs data, it asks the back end through an API (application programming interface), a set of agreed addresses and formats. Think of a menu: the front end can only order what the back end has published, in the format it expects. The request itself is ordinary HTTP. The answer is usually JSON, a lightweight text format of names and values that both sides can read, and because JavaScript can fetch JSON in the background, a page can update one part of the screen without reloading everything.
Tracing one click through a fintech app
Sometimes the balance on the app's dashboard shows zero, and Aditi wants to know why. She's a product analyst at a fintech start-up in Pune, so she follows a single click from start to finish:
- When the user opens the dashboard, the front end sends GET /api/accounts/482/balance.
- On the server, the back end checks the login token and then queries the database.
- The reply is 200 OK, carrying the JSON {"balance": 15250, "currency": "INR"}.
- The front end picks out the balance field and puts 15,250 rupees on screen.
During a slow moment Aditi opens the Network tab and compares the response with the screen. When the database is slow, the back end gives up and returns a 500 error. The front end ignores the error and shows its default value of zero, so a customer with 15,250 rupees sees 0. After the fix, the front end checks the status code first and shows "Balance unavailable, please try again". The stored balance had been right all along. The fault was in how the screen handled the error.
A wrong number on screen doesn't have to mean wrong data in the database. The data may be correct while the front end handles an error badly, or the reverse. Look at the actual request and response before you decide which side to fix.
Practical takeaway
For any feature, you want three answers: what the browser shows, what the server does, and what data passes between them. If you can draw those three boxes and the arrows between them, you understand the system well enough to discuss it with developers.
Checkpoint
How the Web Works

Checkpoint: The order page that will not load
How a good diagnosis runs
A good diagnosis follows the route a request takes. It starts in the browser, since the Network tab lists every request with its status code and timing. Say the page itself loads but one API call fails: then the front end is probably fine and the back end needs attention, so the server logs for that request come next. When you report, give what failed, the evidence and the likely owner. That habit saves time whether you write code or not.
Ce chapitre
- DNS (Domain Name System) KEY
- The system that translates a domain name such as example.com into the IP address of the server that hosts it.
- IP address KEY
- A numerical address that identifies a device on the internet so other computers can send data to it.
- HTTP request and response KEY
- The message a browser sends to ask a server for something, and the server's reply containing a status code, headers and content.
- Status code KEY
- A three-digit number in an HTTP response that shows whether the request succeeded, was redirected or failed on the client or server side.
- Hosting BIZ
- The service that provides and runs the server where a website or application lives.
- Content delivery network (CDN) KEY
- A network of servers in many locations that stores copies of a site's files so visitors download them from somewhere nearby.
- API (application programming interface) KEY
- An agreed set of addresses and formats that lets one piece of software request data or actions from another.
- JSON KEY
- A lightweight text format that stores data as names and values, widely used for sending data between front end and back end.



