Evk*_*Evk 19
我做了以下测试:首先创建了简单的HTML页面
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="dns-prefetch" href="//example.com/">
</head>
<body>
<a href="http://example.com">Test link</a>
<a href="http://sub.example.com">Test link 2</a>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
对于我拥有dns名称服务器的域和子域.然后我清理了dns缓存并在firefox私有窗口中打开了这个页面.我在我的dns名称服务器的日志中观察到,只发出了对"example.com"的请求,并且没有子域请求.
然后我按如下方式更改了页面:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="dns-prefetch" href="//example.com/">
<link rel="dns-prefetch" href="//sub.example.com/">
</head>
<body>
<a href="http://example.com">Test link</a>
<a href="http://sub.example.com">Test link 2</a>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
再次清除dns缓存并在firefox私有窗口中打开此页面.现在我观察到dns请求我们为域和它的子域做了.
所以我可以得出结论是 - 您必须单独预取子域.
您必须单独预取每个子域.
这是DNS的工作方式.你问名字,它回答,它对"子域名"一无所知它只是一个名字.
nslookup google.com 只为google.com提供答案,没有子域名.
nslookup www.google.com 仅提供www.google.com,不提供顶级域名.
| 归档时间: |
|
| 查看次数: |
1542 次 |
| 最近记录: |