What happens when we type a URL into a browser?
What is an URL?
URL stands for Uniform Resource Locator. A URL is nothing more than the address of a given unique resource on the Web. In theory, each valid URL points to a unique resource. Such resources can be an HTML page, a CSS document, an image, etc. In practice, there are some exceptions, the most common being a URL pointing to a resource that no longer exists or that has moved. As the resource represented by the URL and the URL itself is handled by the Web server, it is up to the owner of the web server to carefully manage that resource and its associated URL.
- Browser checks cache for DNS entry to find the corresponding IP address of the website. It looks for the following cache. If not found in one, then continues checking to the next until found.
- Browser Cache
- Operating Systems Cache
- Router Cache
- ISP Cache
- If not found in cache, ISP’s (Internet Service Provider) DNS server initiates a DNS query to find IP address of server that hosts the domain name.
The requests are sent using small data packets that contain information content of request and IP address it is destined for.
- The browser initiates a TCP (Transfer Control Protocol) connection with the server using synchronize(SYN) and acknowledge(ACK) messages.
- The browser sends an HTTP request to the web server. GET or POST request.
- Server on the host computer handles that request and sends back a response. It assembles a response in some format like JSON, XML, and HTML.
- Server sends out an HTTP response along with the status of response.
- Browser displays HTML content
- Finally, Done.