iOS 上的 Safari 是否支持 DNS Prefetch 指令?
我最近发现 DNS Prefetch 指令是 HTML5 Boilerplate 模板的一部分。根据 维基百科:
目前任何公认的标准都没有明确定义预取,但 Mozilla 已经宣布了一项互联网草案的工作,该草案将与 Firefox 中的实现相匹配。
我读到的信息早在 2010 年 9 月,就有一个针对 Safari 5.0 的 修复。 1 修复了存在 DNS 预取指令时页面加载缓慢/停滞的问题。但是,我无法了解 iOS 上的 Safari 是否支持 DNS 预取。
我们正在构建一些 HTML 5 页面,这些页面仅在 iOS 应用程序内的 UIWebView 中加载。在此页面上,我们正在加载一些外部资源,因此我想缩短页面加载时间并使用 DNS 预取(如果有帮助的话)。
I've recently come across the DNS Prefetch directive as part of the HTML5 Boilerplate template. According to Wikipedia:
Prefetching is not currently explicitly defined by any accepted standards, but Mozilla have announced work on an Internet Draft, that will match the implementation in Firefox.
<link rel="prefetch" href="http://www.example.com/">
I read information that back in September 2010, there was a fix for Safari 5.0.1 that fixed slow/stalled page loads when DNS Prefetch directives were present. However, I couldn't any information on whether Safari on iOS supports the DNS Prefetch.
We are building some HTML 5 pages that are loaded exclusively in a UIWebView within an iOS app. On this page there are a few external resources we're loading so I'd like to improve page load times and use the DNS Prefetch if it's going to help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,无法给出令人满意的完整答案,但根据 http://osdir.com/ml/phonegap/2011-07/msg00770.html
Unfortunately can't give a satisfying complete answer, but definitely not before iOs 4.3.3 according to http://osdir.com/ml/phonegap/2011-07/msg00770.html
据 CanIUse.com 称,移动版和 iOS 版 Safari 均不支持预取。在撰写本文时,该版本涵盖了 10.0 版本。
我可以使用...资源提示:预取
如果这些平台需要预取,有几种可能的解决方法。它们中的大多数通过在页面上使用之前引用 CSS/JavaScript 中的预加载资源来发挥作用。
According to CanIUse.com, prefetch is unsupported by both mobile and iOS versions of Safari. At the time of this post, that covered version 10.0.
Can I Use... Resource Hints: prefetch
If prefetching is necessary for those platforms, there are several possible work arounds. Most of them function by referencing the preload resource in CSS/JavaScript prior to using it on the page.