Site optimization should pay attention to DNS pre-acquisition (DNS prefetching)

Source: Internet
Author: User
Tags prefetch

Website optimization technology is always evolving. Today I re-read the previous front-end optimization notes and found that the section on YSlow Optimization 34 guidelines on reducing DNS lookups (reduce DNS lookups) should probably be revised.

DNS as the foundation of the Internet Protocol, the speed of its resolution seems easy to be overlooked by site optimization personnel. Now that browser vendors have been optimized for DNS , a typical DNS resolution is 20-120 milliseconds, reducing the number of DNS resolutions is an optimized way to reduce DNS The time to parse is also a cost-effective thing. This is the main reason that browser vendors attach importance to DNS prefetching. DNS prefetching for performance gains can be simply explained by "DNS synchronous request to Async", that is, the domain name with this attribute does not require the user to click the link in the background parsing, and the domain name resolution and content loading is a serial network operation, so this way can reduce the user's waiting time, Enhance the user experience.

Google Chrome has a built-in DNS prefetching technology (note that there have been several minor versions of this feature that have led to performance problems), and Firefox 3.5 introduces this new feature. As for IE 8, I don't see any action at the moment (perhaps I didn't notice it).

For a Web site, if you want to take full advantage of the user browser side of this feature, you can add the link property on the page anchor point to do. Similar:

<link rel= "Dns-prefetch" href= "http://www.google-analytics.com/" >

There is also the need for this x-dns-prefetch-control to be used appropriately. This may be especially useful for some sites that reference some of Google's service scripts.

Another way to speed up DNS is to consider using a cache DNS proxy server such as PDNSD to speed up some DNS requests.

In Chrome, you can observe some interesting DNS performance data by entering about:histograms/DNS in the Address bar.

--eof--

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.