我的问题很简单:
是否存在HTTP / SPDY协议的任何(现有的或计划的)增强,或者为了使浏览器能够修改其渲染例程而编写的扩展,以便可以向用户隐藏不同内容的Flash?
当然,IE用户将落后于其他所有人,但我认为这对于有线协议是一个明智的增强,只需要额外的几个字节左右,并减少额外的JS渲染。< / p>
或者这种策略是否会面对普遍的渐进增强理念?
如评论中所述,这可以作为第三方扩展实施,还是作为集中标准实施更好?
答案 0 :(得分:0)
HTML Imports就是这样一个功能:
HTML导入阻止主页面的渲染。这类似于
<link rel="stylesheet">
所做的。浏览器首先在样式表上阻止渲染的原因是最小化无样式内容(FOUC)的闪烁。 HTML Imports的行为类似,因为它们可以包含样式表。通过此更改,HTML导入中
document.write
个标记的所有<script>
输出都会转到导入的HTML文档中。这消除了HTML导入清除主页面的问题。
链接预呈现将是另一个:
IE11可以在后台预呈现一页。如果遇到第二个预渲染请求,它将替换第一个请求。其他预渲染请求将被忽略。
<link rel="prerender" href="http://example.com/" />
开发人员可以微调IE11优先考虑资源下载的方式。对于某些网页,内置优先级方案可能不够。例如,开发人员可能希望指出位于首屏下方的图像的优先级应低于位于首屏上方的更重要的资源。
IE特定的lazyload
属性是第三个:
开发人员可以通过添加lazyload标记来降低资源的优先级:
<img src="image.jpg" lazyload />
最后,defer
元素的async
和<script>
属性:
Usage Description <script src="widgets.js"></script> The script is executed immediately, and the page waits for the script to finish before continuing to parse. This can significantly reduce page-load performance. <script async src="widgets.js"></script> The script is downloaded asynchronously while the page continues to parse. The script executes after the download has completed. <script defer src="widgets.js"></script> The script is executed when the page is finished with the parsing. <script async defer src="widgets.js"></script> The async attribute is honored, and the defer attribute is ignored. This enables developers to use async in browsers that support it, but fall back to defer in browsers that don't support async.
<强>参考强>