dns预解析

dns-prefetch指令,当然在浏览器支持方面google chrome、 firefox3.5浏览器 、safari 5+、IE9等。dns-prefetch放入位置推荐在后面。具体代码为:

<meta http-equiv="x-dns-prefetch-control" content="on" />
<link rel="dns-prefetch" href="//portal.gdbs.gov.cn" />
<link rel="dns-prefetch" href="//www.gdbs.gov.cn" />

需要注意,虽然dns-prefetch能够加快网页解析速度,但是也不能随便滥用,因为多页面重复DNS预解析会增加重复DNS查询的次数。

查看缓存

chrome://net-internals/#dns

原文地址:https://www.cnblogs.com/liluredhat/p/7192578.html