Web browsers have evolved to handle their own unique way of loading web pages. There are more components in a web page than in the past, hence it is vital for web browsers to load them faster. Here are some speed enhancement techniques that different web browsers use to optimize the loading time.
One of the areas that web browsers looked into optimizing is cutting the connection time between a web browser and a Domain Name Server. DNS allows the client's browser to translate a hostname into a network IP address. The process can take a few milliseconds to several seconds. This is why it is important to optimize the connection to the DNS server. DNS Prefetching attempts to resolve domain names before the user tries to follow a link. Once a domain name has been resolved, if we do navigate to that domain, there will be no effective delay due to DNS resolution time. While download speed remains the same, the end-user saves time by not having to look up the IP address.
- Internet Explorer 9 can prefetch using the address bar after you type the third character, IE will issue a DNS resolution for the top 5 hostnames in the drop-down. These resolutions are stored in the local operating system cache for quick reuse in the future. In addition, IE can resolve any hostnames for a resolution that are specified by the web developer in this way:
<link rel="prefetch" href="http://www.example.com/someresource.htm">
- FireFox 3.5 performs DNS prefetching as well. It pre-fetches the URLs that are being included in the current document. The implementation allows the domain name resolution to occur in parallel with the fetching of actual page content. Thus, the high latency domain name resolution process doesn't cause any delays during the process of fetching content.
- Chrome looks for the first available socket (pre-connect socket) to start and establish a connection and then uses the Predictor infrastructure that uses DNS pre-fetching technique. By the time the browser wants to initiate a resource request, the socket connect has often already started or even completed. The Predictor infrastructure predicts based on past browsing, for given network topology, what is the maximum number of concurrent transactions that we want and take advantage of the genericized socket pool infrastructure to fully connect a socket.
DNS Client receives a request to resolve the DNS name that it does not contain in its cache, it queries an assigned DNS server for an IP address for the name. If the DNS client service receives the requested address, it stores the name and address in its cache to resolve future requests without having to query the DNS server. In IE, when you visit a site, IE will annotate the page’s history entry with the list of hostnames that were contacted to download the content used by the page. IE has a default size of 1/256th of the total disk capacity, with a cap on the default to 250 megabytes. It also had cache clean up algorithms that remove 10% of the objects in the cache.
Another area that web browsers look into improving is the TCP connection itself. TCP Preconnect allows you to make a connection to a site before you have a request to use that connection for. This technique saves time when your initial TCP connection fails. It takes 3 seconds to retry SYN.
Chrome looks for the first available socket (pre-connect socket) to start and establish a connection before the browser completes a TCP connection as well as a backup socket.
Firefox 4.0 takes a similar approach by creating two TCP connections and if both of the connections are successful it stores the other one as a cache. It is a prefetched TCP connection.
IE 9 uses 2 sockets in parallel. The second socket is used as a background connection that is available for the next HTTP request without forcing it to wait for the original connection to become available and without the delay of opening a new connection.
Other articles in this series: