问题描述
参考这个问题 , 如何获取当前页面大小 (kb), 我将使用这个大小来了解该页面的连接速度.
Referring to this question , how can i get the current page size in kb, this size i will use to know the connection speed for this page.
推荐答案
除非你的页面大小以兆字节为单位,否则结果将毫无意义.
Unless your page has size in megabytes, the result will be meaningless.
这是因为连接、发送请求和等待服务器发送回复所需的时间是 相当大 与下载页面所需的时间相比,此外 TCP/IP 还有 慢启动.
This is because time needed to connect, send request, and wait for server to send reply back is quite large compared to time required to download the page, and in addition to that TCP/IP has slow start.
您还必须考虑缓存、代理和浏览器将建立的并行连接数(例如,可能优先下载脚本和样式,使页面下载时间显得很慢).
You also have to take into account caches, proxies and number of parallel connections that browser will make (e.g. may prioritize download of scripts and styles, making page download time appear slow).
这篇关于如何仅使用 javascript 获取以 KB 为单位的当前页面大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!





大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)