What happens when we visit a URL? Follow the thread for a short concise answer. #howwebworks #web #webdevelopment #interview #question #frontend The beautifully written detailed resource can be found here : github.com/alex/what-happ…
1. Every URL has a unique IP address associated with it. These mappings are stored in DNS servers and are called DNS records.
2. Let's say we visit google.com. A DNS lookup is performed. To save computers searching the entire web, it first searches for the DNS records locally.
3. The browser checks for the IP address of the URL(DNS records) in its cache. If it doesn't find the records it moves to OS cache, Router cache and finally the query is sent to the ISP to check its cache.
4. If the record is still not found, a full DNS search is conducted. The request is made to different DNS servers. (DNS records are not stored on any one server but are distributed among several global servers) The below figure shows the DNS hierarchy.
5. Google server will find the matching DNS record and returns the required IP address to the browser.
6. Once the browser has the IP address, it then initiates a TCP connection with the server via 'TCP-3 way handshake'. (I)Client sends SYN signal asking the server if it is open for connection. (ii) If the server is up it sends SYN/ACK signal. (iii) Client sends back ACK signal.
7. Once the TCP connection is established for data transmission, the browser can then communicate with the server via HTTP requests and ask for the resources.(HTML, CSS, images, etc.)
8. The server supplies the browser with the resources which the browser then parses and renders on the screen which we as the user see.
That's it. All the above process happens when we visit a URL though it hardly takes a second to complete. Now you're ready with the question which can possibly appear in your next interview.
United States Trends
- 1. Good Monday 30.1K posts
- 2. #MondayMotivation 32.6K posts
- 3. Rudy Giuliani 18K posts
- 4. Happy Birthday Marines 3,959 posts
- 5. #Talus_Labs N/A
- 6. #MondayVibes 2,080 posts
- 7. Semper Fi 4,080 posts
- 8. Pond 169K posts
- 9. Happy New Week 47.3K posts
- 10. United States Marine Corps 4,636 posts
- 11. The BBC 443K posts
- 12. Mark Meadows 17.1K posts
- 13. 8 Democrats 11.8K posts
- 14. Resign 120K posts
- 15. #ITZY_TUNNELVISION 39.7K posts
- 16. #USMC N/A
- 17. Steelers 54.5K posts
- 18. Ghislaine Maxwell 5,861 posts
- 19. Tim Kaine 26.8K posts
- 20. Sidney Powell 10.8K posts
Something went wrong.
Something went wrong.