简体   繁体   English

网站优化-页面加载时间和DOM操作

[英]Website Optimization - Page Load Time & DOM manipulations

Just wondering whether JavaScript execution ie for DOM Manipulation is taken into account by Tools like http://tools.pingdom.com/ , Google Analytics that calculate a Web pages Load Time obviously there is a distinction between Download Time & Load Time? 只是想知道是否通过http://tools.pingdom.com/之类的工具(即计算网页加载时间的Google Analytics(分析))考虑了JavaScript执行(即DOM操作),显然下载时间和加载时间之间有区别吗? Does Load time include when JS has finished executing? 加载时间是否包括JS完成执行的时间?

Good question! 好问题! The short answer is no. 最简洁的答案是不。

JavaScript "load time" is dependent on complexity, latency to fetch files (CDNs, etc.), and other browser-dependent factors. JavaScript的“加载时间”取决于复杂性,获取文件(CDN等)的延迟以及其他与浏览器有关的因素。

A tool like Google Analytics receives data about the page (through tracking pixels), but isn't the same as a bonafide web browser. 诸如Google Analytics(分析)之类的工具(通过跟踪像素)接收有关页面的数据,但与真正的Web浏览器不同。

A tool like Pingdom or Pingometer which monitors a site either does a HEAD or GET request to the page. 诸如PingdomPingometer之类的监视站点的工具会对页面执行HEAD或GET请求。

In the case of a HEAD request, no code is downloaded or executed -- only headers. HEAD请求的情况下,不会下载或执行任何代码-只会下载标头。

In the case of a GET request, code is actually downloaded (and a factor for load time) but not executed. GET请求的情况下,实际上会下载代码(以及加载时间的因素),但不会执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM