At http://news.ycombinator.com/news, I will see the following article:
Saved 10 billion DNS queries per month by disabling DNS prefetching (pinkbike.com)
Disabling DNS pre-reading can save 10 billion of DNS queries per month
It immediately attracted my attention.
First, the author said that he has recently increased the number of DNS queries by 0.4 billion, forcing him to order a DNS query service worth $1600 per month.
What is DNS pre-read:
DNS prefetching is a fairly recent (added in Safari 7 months ago) enhancement to all the major browsers. after a page loads, the browser looks at all the hosts in the links on the page and in the background proceeds to issue DNS queries to resolve those hostnames.
In order to speed up domain name DNS resolution, the browser will first resolve all links on the webpage.
To prove that the browser pre-read increases the number of DNS queries on the author's website by 800% in a month, the author ruled out other factors that increase the number of DNS queries:
1. DNS ttls
2. Lots of links/images on other sites (leeching by other websites)
3. misconfigured internal services hitting the DNS
Then, the dynect platform is used to obtain a statistical graph of the author's website's DNS data, and then compare it with the number of dynamic web pages generated on the website per second. It is found that there are multiple DNS queries of 120; that is, 120 more DNS queries per second is meaningless.
Then we finally pointed to the browser's DNS pre-access technology.
Then, let's give an example to illustrate a lot of reflections. Finally, we can use Meta to disable DNS pre-storage.
However, I did not check how to set up DNS for the whole website, so I had to check the source code of the author's webpage.
The following code is forbidden: <meta http-equiv = "X-DNS-prefetch-control" content = "off"/> (the author says there is no DNS pre-read behavior in IE8/9 during the test)
However, browser DNS pre-reading actually saves the DNS resolution time when we click the link, which is a speed-up. In addition to the author's website, there are hundreds of comment links.
DNS query is a waste. If a website has no more than dozens of links on a page, you do not need to disable DNS pre-reading.
I just found a lot of interesting comments about this article: http://news.ycombinator.com/item? Id = 2306319