How the web works?
Before we start learning web development, We should first know how actually web works.
The Client-Server relationship is the most common way for a webpage to be shared across multiple computers. The client sends requests for the webpage, which is then loaded and displayed by the server.
For Example: When we go to any restaurant, Whatever food we want to order we tell it to waiter or waitress of the restaurant, Then waiter goes to the chef & tell him to prepare our food. When our food is ready the waiter brings food to our table, Similar things happen in web. Here we are the "client" & waiter act as a "server". when we order something it means we are sending a HTTP request. when waiter brings us food it can be related to "200 OK " message from the server.
Below are Important components which plays vital role in communication between client & server
-Internet connection:
Internet is a string of ones and zeroes that moves from one computer to another. When someone says 'the internet', they're referring to a network of computers that connect people to each other, allowing them to send and receive information without human intervention. Most users access the internet via broadband.
-TCP/IP:
Transmission Control Protocol and Internet Protocol are the core messaging protocols for TCP/IP, the most common networking protocol in use today. You've probably heard of it: It's the protocol that phone numbers, domain names, email addresses, chat conversations, and all other bits of data -- from your computer to a website to every other device on earth -- travel through on their way from Point A to Point B.
-DNS:
We need to locate the website's IP address before we can access the website. This means we'll look up the address of the shop in a directory (like an address book) and then type in the relevant web address together with the 'port' (which tells browsers where to send HTTP requests). The browser will then look up that IP address using DNS, find out which server you want to connect to and retrieve it.
-HTTP:
Hypertext Transfer Protocol (HTTP) is the language that clients and servers use to communicate and exchange data over a network.
-Component files:
A website is made up of many different files. These files come in two main types: code (HTML, CSS, and JavaScript) and assets (all the other stuff that makes up your website).
So how web works?
The browser goes to the DNS server, and finds the real address of the server that the website lives on (you find the address of the shop). The browser sends an HTTP request message to the server, asking it to send a copy of the website to the client (you go to the shop and order your goods). This message, and all other data sent between the client and the server, is sent across your internet connection using TCP/IP. If the server approves the client's request, it sends a "200 OK" message telling you that you can look at that website! Here it is," and then starts sending file chunks or files as a series of small packets or messages called data packets. The browser assembles these small messages into different web pages which it displays to you.