In the Web experience, we often encounter this situation, that is, in the call Baidu Alliance, Google Alliance and the current page is located outside the domain name of the domain file will encounter the request delay very serious situation. So is there a way to solve this kind of request serious delay phenomenon?
In general, the reason for this delay is not the other site bandwidth or load reasons, then what is the cause of this situation. The assumption is that DNS is a problem because DNS resolution speed is probably the biggest cause of resource latency. The following code (used for DNS pre-parsing) was added to the header of the page:
<meta http-equiv= "X-dns-prefetch-control" content= "on"/><link rel= "Dns-prefetch" href= "/HTTP/ Bdimg.share.baidu.com "/><link rel=" Dns-prefetch "href=" http://nsclick.baidu.com "/><link rel=" Dns-prefetch "href=" http://hm.baidu.com "/><link rel=" Dns-prefetch "href=" http://eiv.baidu.com "/>
The effect is very good (test browser for IE8), and then open other pages when the Baidu share button loading significantly improved!
Let's take a brief look at Dns-prefetch:
DNS as the foundation of the Internet Protocol, the speed of its resolution seems easy to be overlooked by site optimization personnel. Most new browsers are now optimized for DNS resolution, and a typical DNS resolution takes 20-120 milliseconds, reducing the time and frequency of DNS resolution is a good way to optimize. DNS prefetching is the domain name that has this attribute does not need the user clicks the link to parse in the background, but the domain name resolution and the content loading is the serial network operation, therefore this way can reduce the user's wait time, enhances the user experience.
Browser to the site for the first time domain DNS resolution lookup process is:
Browser Cache-System Cache-Router cache-isp DNS Cache-Recursive search
Chrome built-in DNS prefetching technology, Firefox 3.5 also introduced this feature, because Chrome and Firefox 3.5 itself to the DNS pre-resolution of the corresponding optimization settings, So one of the bad effects of setting up DNS pre-resolution is that it may reduce the user experience of Google Chrome and Firefox 3.5 browsers.
Pre-resolved implementations:
1. Use meta information to inform the browser, the current page to do DNS pre-resolution: <meta http-equiv= "X-dns-prefetch-control" content= "on"/>2. Use the link tag in the page header to force DNS pre-parsing: <link rel= "Dns-prefetch" href= "http://bdimg.share.baidu.com"/>
Note: Dns-prefetch need to use caution, multi-page repeated DNS pre-resolution will increase the number of repeated DNS queries.
Ps:dns pre-parsing is mainly used for site front-end page optimization, in the role of SEO blue has not been verified, but as a part of the enhanced user experience rel= "Dns-prefetch" may be worth the time to discover.
Front-End optimization: DNS pre-parsing improves page speed