链接元素预取在 Firefox 3.6 中不起作用
我正在尝试在 Firefox 3.6 上测试预取。我正在使用:
<link rel="prefetch" href="hst_galaxy.jpg"/>
我在 Firebug 的网络面板中没有看到任何请求。当我查看 Apache 2 日志时,我只看到页面请求,后面什么也没有。我也没有看到预期的 X-moz: prefetch
标头。我还使用 Wireshark 检查了数据包,并且未发送预取标头。我还使用了 LiveHttpHeaders(FF 扩展),并且再次未发送预取标头。
我检查了我的 about:config 选项并启用了“network.prefetch-next”。
我的测试设置是在 Mac OS 10.5.8 上。我正在使用 Apache 的本地安装,并从站点目录中的测试 HTML 文件运行它。我尝试了 3 个不同的域选项:
- localhost/cachetest
- localhost.com/cachetest
- www.randomurl.com/cachetest
localhost.com 和 randomurl.com 是我在 /etc/hosts 文件中配置的域。测试页面可以访问。
我访问过此页面,其中显示检测到 X-Moz
标头。 http://browserspy.dk/prefetch.php 在 Firefox 中,它说是。在 Chrome/Safari 中,它显示“否”,这是意料之中的。同样,我无法检测到使用 Wireshark 或 LiveHttpHeaders 发送的 X-Moz
标头。当查看该页面的源代码时,我确实看到了正确类型的 元素。
我真的不确定我错过了什么。我对此进行了非常彻底的测试,如果我没有从 Firefox 中检测到任何内容并且在 Apache 中没有记录任何内容,我不知道这可能如何工作。
有人有一些启示可以分享吗?
I am trying to test prefetching on Firefox 3.6. I'm using:
<link rel="prefetch" href="hst_galaxy.jpg"/>
I don't see any requests in Firebug's Net panel. When I look at the Apache 2 logs, I see only the page request, nothing after. I don't see the expected X-moz: prefetch
header either. I have also inspected the packets using Wireshark and the prefetch header is not being sent. I also used LiveHttpHeaders(FF extension), and again the prefetch header isn't sent.
I checked out my about:config options and "network.prefetch-next" is enabled.
My test setup is on Mac OS 10.5.8. I am using the local installation of Apache, and running this from a test HTML file in the sites directory. I've tried 3 different domain options:
- localhost/cachetest
- localhost.com/cachetest
- www.randomurl.com/cachetest
localhost.com and randomurl.com are domains I have configured in my /etc/hosts file. The test page is accessible.
I've visited this page which says the X-Moz
header is detected. http://browserspy.dk/prefetch.php
In Firefox, it says yes. In Chrome/Safari it says no, which is expected. Again, I cannot detect the X-Moz
header being sent with Wireshark or LiveHttpHeaders. When looking at the source of that page, I do see the right kind of <link rel="prefetch">
element though.
I'm really not sure what I'm missing. I've been pretty thorough with testing this and I don't see how this possibly is working if I detect nothing from Firefox and record nothing in Apache.
Does anyone have some enlightenment they can share?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Firefox 3.6 中存在一个错误,当启用 HTML5 解析器时,会导致预取失败。您还可以尝试元语法:
看看这是否有任何区别。
There's a bug in Firefox 3.6 which causes prefetch to fail when the HTML5 parser is enabled. You can also try the meta syntax:
To see if that makes any difference.