Html 什么是渐进式渲染?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33651166/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is progressive rendering?
提问by Natumsol
回答by cfreear
Progressive rendering is the name given to techniques used to render content for display as quickly as possible.
渐进式渲染是用于尽可能快地渲染内容以供显示的技术的名称。
It used to be much more prevalent in the days before broadband internet but it's still useful in modern development as mobile data connections are becoming increasingly popular (and unreliable!)
在宽带互联网出现之前,它曾经更加流行,但随着移动数据连接变得越来越流行(而且不可靠!),它在现代发展中仍然有用。
Examples of such techniques :
此类技术的示例:
- Lazy loadingof images where (typically) some javascript will load an image when it comes into the browsers viewport instead of loading all images at page load.
- Prioritizing visible content(or above the fold rendering) where you include only the minimum css/content/scripts necessary for the amount of page that would be rendered in the users browser first to display as quickly as possible, you can then use deferred javascript (domready/load) to load in other resources and content.
回答by Naman Sancheti
This pertains to the idea of sending data in chunkswhen doing Server side renderingrather than all at once. The advantage is reduced TTFB(Time to first Byte) i.e. the time period between the browser making the HTTP request and it receiving the first byte.
这与在进行服务器端渲染时分块发送数据而不是一次全部发送的想法有关。优点是减少了TTFB(第一个字节的时间),即浏览器发出 HTTP 请求和接收第一个字节之间的时间段。
See below 'JSConf' talk for a detailed explanation: https://www.youtube.com/watch?v=aRaQe9n1lPk
有关详细说明,请参阅下面的“JSConf”演讲:https: //www.youtube.com/watch?v=aRaQe9n1lPk