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

页面性能收集 #163

Open
lovelmh13 opened this issue Jul 26, 2021 · 0 comments
Open

页面性能收集 #163

lovelmh13 opened this issue Jul 26, 2021 · 0 comments

Comments

@lovelmh13
Copy link
Owner

w3c 制定了相关的性能标准,可以进入这里查看:Spec status @ W3C Webperf WG : Status

里面的 status 如下:

工作草案(WD)
候选推荐标准(CR)
提案推荐标准(PR)
W3C推荐标准(REC)
具体可以查看:W3C推荐标准
PerformanceNavigationTiming 与 PerformanceResourceTiming 的关系
PerformanceNavigationTiming 继承自 PerformanceResourceTiming,所以包含 PerformanceResourceTiming 中的所有内容(只是有相同的属性,值不一样。因为 PerformanceResourceTiming 是中是每个资源的时间属性,而 PerformanceNavigationTiming 是页面导航的)

具体内容可见:Navigation and resource timings 的后面部分

**什么是导航:用户发起 URL 请求到页面开始解析这个过程,被称为导航。**这应该就意味着页面一开始要用的资源都已经被加载完成了。

PerformanceNavigationTiming

image

PerformanceResourceTiming

image

PerformanceNavigationTiming 与 PerformanceTiming 的关系

Performance Timing 通过 performance.timing 获取,目前已经被淘汰,不建议使用。

PerformanceNavigation Timing 通过 performance.getEntriesByType('navigation')[0] 获取,代替 performance.timing。

具体内容可见:Navigation and resource timings 的前半部分

image

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