How Does a Website Work?

Let’s try to understand in a simple way how a website works.

In fact, surfing the Web is an exchange. Wow, that’s beautiful! No really, the Web is an exchange system between a client and a server.

  • The client is us, it’s our web browser, it’s the one that will allow us to see the web from our computer, smartphone or tablet. It is the one you probably know as Chrome, Firefox, Safari, Edge, etc..
  • And the server is actually a powerful computer that stores and hosts websites. It is on this computer that the web pages are located, i.e. all the files of the website you want to access. The purpose of the web server is to serve clients, hence the name “server”.

Related article: How does a browser work?

How is the communication between the client and the server?

The client accesses a web page by using the address of a web site – called URL – in his browser.

The URL can be broken down into several parts:

  • “http” is the name of the communication protocol between the client and the server,
  • “mywebsite.com” is the domain name of the website you want to access,
  • “myfolder/page.html” is the location of the page in the website.

The communication between client and server is done in three steps:

  1. First, the client orders a web page from the server. He enters the URL of a website in his browser. The latter immediately sends a web request to the server.
  2. Then, the server prepares this order, i.e. the web page in question. The server will process the request and return the requested data (web page, image, video…).
  3. And finally, the browser interprets the data received and sends them back to the client who will display them directly on our screen

What are the different types of websites?

Sometimes, the role of the server is really simple, this is the case for static websites.

The client sends a request to the server, which simply returns the requested page. The server does no work on the page in question, hence the term “static”.

A static site is used when you just need to present information. This is called a showcase site. Creating a static web page is very simple and is within the reach of everyone.

But sometimes the server must work a little harder and this is the case for dynamic websites.
When the client orders a page from the server, the server prepares this order. It does a real work on it before sending it back to the client.

For example Facebook is a dynamic site. The content is different and personalized for each user.

What are web pages “made of”?

As you have understood, a visit to a website is the result of a communication between a client and a server.
What the client – Web browser- receives will be written in client language, this is the visible part of the Iceberg often called “Front-End”.

On the other hand, all the work that the server will do on our Web pages before sending them to the client will be written in server language, this is the hidden part of the Iceberg often called “Back-End”.

CMS (Content Management System)

You’ve probably heard of WordPress, well, it is a CMS.

CMS are actually dynamic turnkey websites. It’s great for someone who doesn’t know how to code because they’ll be able to create a website pretty quickly.

They will still be limited as soon as they want to customize it a little bit and that’s why it’s best to know the basics of web development even if you decide to work with a CMS.

Related article: What are website cookies used for?