No history yet

Web Foundations

The Client and the Server

Every time you visit a website, you are participating in a conversation. It's a simple, two-way exchange that powers the entire web. On one side, you have the 'client'. On the other, the 'server'.

Think of it like ordering food at a restaurant. You, the customer, are the client. You have a request: a pizza, perhaps. The restaurant's kitchen is the server. Its job is to hold all the ingredients and, upon receiving your order, assemble it and send it back to your table. Your web browser (like Chrome, Firefox, or Safari) is the client. When you want to visit a website, your browser sends a request across the internet to a powerful computer called a server. This server stores all the files that make up the website—text, images, videos, and the code that holds it all together. Once the server receives the request, it finds the correct files and sends them back to your browser. Your browser then assembles these files into the webpage you see.

Lesson image

Your Digital Address

But how does your browser know where to send the request? Every device connected to the internet, including the server hosting the website, has a unique address. This is called an IP address (Internet Protocol address), and it looks something like this: 172.217.169.67. Think of it as the digital equivalent of a home address. Without it, information wouldn't know where to go.

An IP address is a unique string of numbers that identifies a specific computer on a network. It's the fundamental addressing system for the internet.

Memorising long strings of numbers for every website you want to visit would be impossible. That's where the (DNS) comes in. The DNS is the internet's phonebook. It translates human-friendly domain names, like google.com, into their corresponding IP addresses that computers understand. So when you type a website address into your browser, a DNS server looks up the name, finds the matching IP address, and tells your browser where to send its request.

Speaking the Web's Language

Once your browser knows the server's address, it needs to speak a language they both understand. This language is called the Hypertext Transfer Protocol, or HTTP for short. HTTP provides a standard set of rules for how clients request information and how servers respond. Think of it as the polite grammar of the web's conversation. The request your browser sends is an HTTP request, and the files it gets back are delivered in an HTTP response.

This whole process is kicked off by the URL you type into your browser. A URL, or Uniform Resource Locator, is a full web address that contains all the information needed to find a specific resource online. Let's break one down:

http://www.example.com/about/contact.html
PartWhat it means
http://The protocol. It tells the browser which set of rules to use for communication.
www.example.comThe domain name. This is the human-friendly address for the server.
/about/contact.htmlThe path. This points to the specific file or resource being requested from the server.

The Browser's Job

The server's response isn't a beautiful, interactive webpage. It's a collection of files, primarily code. The most important of these is usually an HTML file, which provides the basic structure and content of the page. It might also include CSS files for styling (colours, fonts, and layout) and JavaScript files for interactivity (animations, pop-ups, and other dynamic features).

Lesson image

It is the web browser’s job to act as an interpreter. It reads the HTML to understand the structure, applies the CSS rules to make it look good, and runs the JavaScript code to make it work. It takes these separate text-based files and renders them into the single, visual webpage you experience. This entire cycle, from typing a URL to seeing a webpage, happens in the blink of an eye, thousands of times a day.

Now you have a basic map of how the web works. Web development is simply the art of creating the files that servers send to clients, and that browsers turn into websites.

Quiz Questions 1/5

In the client-server model of the web, what is the role of the 'client'?

Quiz Questions 2/5

What is the primary function of the Domain Name System (DNS)?