如何使用HTML5预加载页面? [英] How can I preload a page using HTML5?

查看:213
本文介绍了如何使用HTML5预加载页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我记得读过有关使浏览器预加载页面的元标记。又是什么标签?

解决方案

预取包含在资源提示下的W3C规范。它在Firefox 12.1之后的Firefox,Chrome,IE 11,Edge,Opera以及4.4.4的Android Browser中实现,请参阅 caniuse预取页面以获取更多和最新的详细信息。



另请参阅相关技术的caniuse和spec页面(之后支持的浏览器从caniuse和截至2015年9月的最新信息):




  • 预渲染 caniuse / 规范(IE 11 ,Edge,Chrome,Opera)

  • 预连接 caniuse / 规范(Firefox,Chrome 46,Opera 33)

  • DNS预取 caniuse / 规范(IE9(参见注释),IE10,除Opera Mini以外的其他浏览器,或者iOS Safari和Android浏览器)



实施IE 9 DNS预取,但将其称为prefetch(谨慎!)。一段时间的Chrome(至少到2013年)只做了预渲染和DNS预取。 IE11为图像实现 lazyload ;微软试图让它达到规格,但到目前为止它不是。 iCab 被称为是第一个实现预取的浏览器,尽管这种行为是自动的,不受标记控制。




历史背景



Mozilla应用程序套件后来,Firefox,实现规范(规范实际上是基于Mozilla早期实现的预取,这有点基于 Link:标头://tools.ietf.org/html/rfc2068> RFC 2068 ,现已被 RFC 2616取代a> [没有引用链接:标题]。请参阅这个旧版本的文档

I remember reading about a meta tag that makes the browser preload a page. What's the tag again?

Prefetching is included in a W3C spec under the name Resource Hints. It is implemented in Firefox, Chrome, IE 11, Edge, Opera after 12.1, and the Android Browser from 4.4.4, see the caniuse prefetch page for more and up-to-date details.

Also see the caniuse and spec pages for related technologies (supported browsers afterwards are retrieved from caniuse and up-to-date as of September 2015):

  • Prerendering caniuse / spec (IE 11, Edge, Chrome, Opera)
  • Preconnecting caniuse / spec (Firefox, Chrome 46, Opera 33)
  • DNS Prefetching caniuse / spec (IE9 (see note below), IE10, every other browser except Opera Mini and perhaps iOS Safari and the Android Browser)

IE 9 implemented DNS prefetching only but called it "prefetch" (caution!). Chrome for a while (at least as far as 2013) only did prerendering and DNS prefetching. IE11 implements lazyload, for images; Microsoft has tried to get it in the spec but so far it isn't. iCab is stated to have been the first browser to implement prefetching, although this behaviour was automatic, not controlled by the markup.


Historical background

The Mozilla Application Suite, and later, Firefox, implement the spec (the spec is actually based on Mozilla's early implementation of prefetching, which was somewhat based on the Link: header specified in RFC 2068 which has now been superseeded by RFC 2616 [which does not reference the Link: header]. See this old version of the docs (

这篇关于如何使用HTML5预加载页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆