Skip to main content

Posts

Showing posts from March, 2013

What really happens when you navigate to a URL

As a software developer, you certainly have a high-level picture of how web apps work and what kinds of technologies are involved: the browser, HTTP, HTML, web server, request handlers, and so on. In this article, we will take a deeper look at the sequence of events that take place when you visit a URL. 1. You enter a URL into the browser It all starts here: 2. The browser looks up the IP address for the domain name   The first step in the navigation is to figure out the IP address for the visited domain. The DNS lookup proceeds as follows: Browser cache –  The browser caches DNS records for some time. Interestingly, the OS does not tell the browser the time-to-live for each DNS record, and so the browser caches them for a fixed duration (varies between browsers, 2 – 30 minutes). OS cache  – If the browser cache does not contain the desired record, the browser makes a system call (gethostbyname in Windows). The OS has its own cache. Router cache