Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(html)白屏和首屏渲染时间 #27

Open
Zhengy1995 opened this issue Mar 20, 2020 · 0 comments
Open

(html)白屏和首屏渲染时间 #27

Zhengy1995 opened this issue Mar 20, 2020 · 0 comments

Comments

@Zhengy1995
Copy link
Owner

Zhengy1995 commented Mar 20, 2020

白屏时间

  1. 定义:从输入url并按下回车到页面渲染出第一个元素的时间。
  2. 影响因素:一般会受网速、dns解析、html头部文件(一般为css、js文件)解析影响
  3. 优化:提高网速、优化dns配置、将size较大的css与js文件置于body标签后加载

首屏时间

  1. 定义:从输入url并按下回车到页面渲染首次全部内容的时间
  2. 过程:html开头 -> css文件加载 -> html内容 -> js文件加载 -> ajax请求 -> 数据渲染
  3. 影响因素:白屏时间、资源文件的处理与执行(css、js、图片等)
  4. 优化:减少白屏时间、服务端渲染(可将首屏渲染过程缩短为前三步,但会增加白屏时间)、异步加载js文件
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant