Lesson 1.2: Client-Server Model & How Websites Work
🔹 Introduction
Every website you visit runs on a simple principle called the Client–Server Model. Understanding this model is the key to knowing how browsers display web pages.
🔹 Key Terms
-
Client → The user’s device (computer, laptop, or mobile) running a browser like Chrome, Firefox, or Safari.
-
Server → A powerful computer where website files (HTML, CSS, JS, images, database) are stored.
-
Request → A message sent from the client to the server asking for resources (like a web page).
-
Response → The reply sent by the server containing the requested resources.
🔹 How Websites Work – Step by Step
-
A user types a URL (e.g.,
www.example.com) in the browser. -
The browser sends a request to the server where the website is hosted.
-
The server receives the request and processes it.
-
The server sends back a response (HTML, CSS, JavaScript files).
-
The browser interprets these files and displays the final webpage to the user.
🔹 Example
👉 When you log in to Gmail:
-
Client (your browser) sends your email and password to the server (Google’s system).
-
The server checks your details in its database.
-
If correct, the server sends a response with your inbox page.
🔹 Why is this Important?
-
Helps developers understand how data flows between user and server.
-
Makes it easier to design fast and secure websites.
-
Forms the base of both frontend and backend development.
📝 Quick Recap
-
Websites follow the Client–Server Model.
-
Client = Browser (sends request).
-
Server = Website storage (sends response).
-
Browser displays the final result to the user.
