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. Nuss 3,243 posts
- 2. #AEWCollision 5,455 posts
- 3. Cam Coleman 3,494 posts
- 4. Lagway 1,863 posts
- 5. Vandy 5,418 posts
- 6. Iowa 30.3K posts
- 7. Auburn 14.7K posts
- 8. #UFCVegas111 12.2K posts
- 9. Ty Simpson 1,841 posts
- 10. Bama 10K posts
- 11. Oregon 38.3K posts
- 12. Ace Austin 1,317 posts
- 13. Wisconsin 18K posts
- 14. Bauer Sharp N/A
- 15. Dante Moore 3,790 posts
- 16. Kyle Fletcher 1,048 posts
- 17. Vanderbilt 4,258 posts
- 18. #Svengoolie 1,472 posts
- 19. Heisman 12.8K posts
- 20. #RollTide 3,728 posts
Something went wrong.
Something went wrong.