Profile Photo

What happens behind the scehen if i hit some domain say https://somedomain.com in browser

Created on: Aug 2, 2024

Suppose i have a domain https://somedomain.com with index page index.html as below

<!DOCTYPE html> <html> <head> <title>Example Page</title> </head> <body> <h1>Hello, World!</h1> <p>This is a paragraph.</p> </body> </html>

When we hit https://somedomain.com from out browser, below process happens.

  1. DNS Resolution Browser query domain name system and get the ip address behind it.
  2. It establiblish connection to web server using SSL/TSL protocol.
  3. It sends get request at / path which resolves to index.html
  4. We server receives the request and send response with index.html along with http headers.
  5. Web browser parses the HTML document and constructs the DOM (Document Object Model) tree which looks like below
- Document - html - head - title ("Example Page") - body - h1 ("Hello, World!") - p ("This is a paragraph.")

Let's try hitting developer.mozilla.org along with developer option. You can see as below

response headers

response text

You can see timing break down phase in chrome. Details are here Timing break down phase in chorome