Server - The Storage Centre

CHAPTER 4

Once you place an order on an online shopping site and the warehouse receives it, they process the order, prepare the package, and ship the product back to you.

Let's see how the Web World Works when a user tries to access a website. 

We already know that the browser will send a Request with proper HTTP/HTTPS protocol and uses IP address to connect to the Server. If you are new to the concept of browser requests, please feel free to refer our Chapter 3 >>>

Let's now focus on how your Response is crafted and delivered to you. 

server


Once your request is in transit, it doesn’t always go directly to the main server of the website (called the origin server). Instead, it often stops at a Content Delivery Network (CDN) — a network of servers located all around the world that store cached copies of website content, closer to where users are. 

This is like having fulfilment centres in various cities that keep popular products in stock for faster delivery.

How does CDN work ?

  • If the CDN already has a copy of the requested content (called a cache hit), it sends it back to your browser right away. 
  • If the CDN doesn’t have the content (a cache miss), it forwards your request to the origin server — the main storage location for the website. The origin server then sends the content back to the CDN, which may store it for future requests, and then passes it to your browser.

So, just like in an online shopping, if your package is available at a nearby fulfilment centre, it gets delivered right away. Otherwise, the request is sent to the central warehouse to fetch the item you ordered.

 If you're curious about what a real server response looks like, you can see it for yourself.

  1. Open a browser on your laptop.

  2. Search for www.beginnerscribble.com

  3. Right-click anywhere on the page and select Inspect (or press F12).

  4. Go to the Network tab.

  5. Refresh the page—you'll see a list of network activities.

Each item in that list represents a request your browser made and the response it received from the server.

If you click on one of them, you'll see detailed information.

  • Under the Response Tab -  shows the HTML content / response data.
  • Under the Headers Tab - choose Response Headers section, you'll find key details such as:

cache-control: private, max-age=0
date: Sat,<Current Date Time Timestamp>
expires: Sat,<Expiry Date Time Timestamp>
server: GSE

The HTTP Server response header describes the software used by the origin server that handled the request and generated a response.

Finally, our browser reads the response content and shows the web page to you. You can dive into Chapter 5 >>> to know how the browser builds the actual Website.

All of this — from placing the request to receiving the full page — happens in just a few hundred milliseconds to a few seconds, depending on your connection and the server’s performance. Learn more about  internet connectivity and service providers in Chapter 6 >>>

BTS: This entire process is a well-orchestrated system involving DNS resolution, ISP routing, CDNs for fast delivery, origin servers for the original content, and HTTP responses carrying the data to your browser.


Comments

  1. The post nicely gives the reader an opportunity to actually visualize the concept through clearcut steps. It was good to try it myself. Also the author does not dump all the concepts on the reader, the gentle coax is enough to keep one interested. And we can start anywhere and finish anywhere and yet feel satisfied. Great attempt !

    ReplyDelete
  2. Thank you so much for your kind words. It means so much to know that the chapters are good enough on their own. Thanks again !

    ReplyDelete

Post a Comment

Enter you valuable comments

Popular