DEV Community

Christina Sharon S
Christina Sharon S

Posted on

How a Request Travels from Client to Server??

Whenever you open a website a request is sent from your device which is the client to a server. The whole process happens in milliseconds but it involves several important steps.

The process begins with typing a website URL (eg:www.wikipedia.org) in the browser and press enter.

The device now needs to find where this website is located on the internet.

Just like when we lose something and start searching the closest place our system searches the cache memory

Checking Local Cache

Before going out to the internet, your system first checks:

  • Browser cache
  • Operating system cache

If the IP address is already stored, the request goes directly to the server.
If not, it moves to the next step.

DNS Query Initiation

Your system contacts a DNS server to convert the domain name into an IP address.

The process goes through:

  • Resolver
  • Root server
  • TLD server
  • SLD server
  • Sub Domain

Finally, the correct IP address of the website is returned.

Sending Request Through Network

Once the IP address is known:

  • The request goes to your router/modem
  • Then to your Internet Service Provider (ISP)
  • From there, it travels across the internet

The data moves through multiple networks to reach the destination server.

Reaching the Server

The server receives the request and checks:

  • Does the resource exist?
  • Is the request valid?

Then it processes the request.

Secure Communication (HTTPS)

If the website uses HTTPS:

  • A secure connection is established using TLS (Transport Layer Security)
  • Data is encrypted before sending

This ensures that sensitive information is protected.

Server Sends Response after processing:

  • The server sends back the requested data
  • This may include HTML, CSS, JavaScript, images, etc.

Display in Browser

  • Your browser receives the response
  • It renders the content
  • You see the website on your screen

Final Flow:

Client -> Cache -> DNS -> IP Address -> Router -> ISP -> Server -> Response -> Browser

Top comments (0)