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. #CARTMANCOIN 1,715 posts
- 2. Broncos 66.1K posts
- 3. yeonjun 217K posts
- 4. Raiders 66.3K posts
- 5. Bo Nix 18.2K posts
- 6. Geno 18.6K posts
- 7. Sean Payton 4,776 posts
- 8. daniela 44.9K posts
- 9. #criticalrolespoilers 4,987 posts
- 10. #TNFonPrime 4,027 posts
- 11. Kenny Pickett 1,508 posts
- 12. Kehlani 9,513 posts
- 13. Jalen Green 7,564 posts
- 14. Bradley Beal 3,531 posts
- 15. Chip Kelly 1,981 posts
- 16. Pete Carroll 1,968 posts
- 17. TALK TO YOU OUT NOW 27.3K posts
- 18. #Pluribus 2,701 posts
- 19. Tammy Faye 1,288 posts
- 20. byers 29.8K posts
Something went wrong.
Something went wrong.