Most asked question in Frontend Interview:
What happens when you type a url in browser?
Thread
#100DaysOfCode
What happens when you type a url in browser?
Thread

Browser checks cache to find the IP of the website. It also checks OS Cache, ISP Cache, Router cache. If not found, ISP starts DNS query to check the IP.
Then Browser initiates TCP connection with Server. Client sends Synchronise Sequence Number to the Server. If server accepts the connection then it acknowledges the packet with another packet. Client then sends acknowledgement as response to server response.
Browser sends HTTP request through the TCP connection.
Server handles the request & sends a http response(json, xml, Html etc).
Server handles the request & sends a http response(json, xml, Html etc).
Browser then accepts the data and renders the HTML. Process continues for other HTTP requests as well.
Handshake is slightly complex for HTTPS. But rest of the process is same.
Feel free to add any intermediate steps.
Handshake is slightly complex for HTTPS. But rest of the process is same.
Feel free to add any intermediate steps.