一、

浏览器根据html中外连资源出现的顺序,依次放入队列(Queue),然后根据优先级确定向服务器获取资源的顺序。同优先级的资源根据html中出现的先后顺序来向服务器获取资源

  • Queueing. 出现下面的情况时,浏览器会把当前请求放入队列中进行排队

    • 有更高优先级的请求时.
    • 和目标服务器已经建立了6个TCP连接(最多6个,适用于HTTP/1.0和HTTP/1.1)
    • 浏览器正在硬盘缓存上简单的分配空间
  • Stalled. 请求会因为上面的任一个原因而阻塞
  • DNS Lookup. 浏览器起正在解析IP地址.
  • Proxy negotiation. The browser is negotiating the request with a proxy server.
  • Request sent. The request is being sent.
  • ServiceWorker Preparation. The browser is starting up the service worker.
  • Request to ServiceWorker. The request is being sent to the service worker.
  • Waiting (TTFB). 浏览器等待响应第一个字节到达的时间. 包含来回的延迟时间和服务器准备响应的时间.
  • Content Download. The browser is receiving the response.
  • Receiving Push. The browser is receiving data for this response via HTTP/2 Server Push.
  • Reading Push. The browser is reading the local data previously received.
  • DNS Lookup - 在浏览器和服务器进行通信之前, 必须经过DNS查询, 将域名转换成IP地址. 在这个阶段, 你可以处理的东西很少. 但幸运的是, 并非所有的请求都需要经过这一阶段.

  • Initial Connection - 在浏览器发送请求之前, 必须建立TCP连接. 这个过程仅仅发生在瀑布图中的开头几行, 否则这就是个性能问题(后边细说).

  • SSL/TLS Negotiation - 如果你的页面是通过SSL/TLS这类安全协议加载资源, 这段时间就是浏览器建立安全连接的过程. 目前Google将HTTPS作为其 搜索排名因素 之一, SSL/TLS 协商的使用变得越来越普遍了.

  • Time To First Byte (TTFB) - TTFB 是浏览器请求发送到服务器的时间+服务器处理请求时间+响应报文的第一字节到达浏览器的时间. 我们用这个指标来判断你的web服务器是否性能不够, 或者说你是否需要使用CDN.

  • Downloading - 这是浏览器用来下载资源所用的时间. 这段时间越长, 说明资源越大. 理想情况下, 你可以通过控制资源的大小来控制这段时间的长度.

根据瀑布图进行性能优化

那么我们如何是一个web页面加载的更快并且创造更好的用户体验呢? 瀑布图提供是三个直观的玩意儿来协助我们达成这一目标:

  1. 首先, 减少所有资源的加载时间. 亦即减小瀑布图的宽度. 瀑布图越窄, 网站的访问速度越快.

  2. 其次, 减少请求数量 也就是降低瀑布图的高度. 瀑布图越矮越好.

  3. 最后, 通过优化资源请求顺序来加快渲染时间. 从图上看, 就是将绿色的"开始渲染"线向左移. 这条线向左移动的越远越好.

如图所示,select2_metro.css在位置上要比avatar1_small.png和index.js靠后,但是优先级确实最高(Higthest-->High-->Medium-->Low),所以这个下载顺序是:select2_metro.css-->index.js-->avatar1_small.png

Connection ID:可以看到总共有6个值--166718、166774、166775、166776、166777、166778,因为浏览器并发数limit是6;如果两个url相同,就表示两个资源的下载共用的同一个tcp长连接

二、filter详解

(1)

Below is a complete list of supported properties. DevTools populates the dropdown with all of the HTTP methods it has encountered. 即写完下面的key+":"后,chrome会自动的弹出后面的值.

  • domain. eg: domain:*.baidu.com会过滤出只有百度的域名.
  • has-response-header. 过滤response的指定header. eg: has-response-header:ETag过滤出所有使用ETag协商缓存的网页。强缓存和协商缓存区别经典讲解:https://www.cnblogs.com/lyzg/p/5125934.html
  • is. Use is:running to find WebSocket resources.   is:running 过滤是通过websocket的网页
  • larger-than.  Setting a value of 1000 is equivalent to setting a value of 1k. eg:larger-than:28000 过滤大于28KB的网页
  • method.  method过滤有多少请求方法,method:OPTIONS指定过滤某个方法
  • mime-type. 展示是json的资源,eg: mime-type:application/json
  • mixed-content. Show all mixed content resources (mixed-content:all) or just the ones that are currently displayed (mixed-content:displayed).
  • scheme. Show resources retrieved over unprotected HTTP (scheme:http) or protected HTTPS (scheme:https).
  • set-cookie-domain. Show the resources that have a Set-Cookie header with a Domain attribute that matches the specified value.
  • set-cookie-name. Show the resources that have a Set-Cookie header with a name that matches the specified value.
  • set-cookie-value. Show the resources that have a Set-Cookie header with a value that matches the specified value.
  • status-code. Only show resources whose HTTP status code match the specified code.

三、同时显示多个按住command键盘+鼠标单选即可

四、请求时间分析

(1)在瀑布流根据"Response Time"、"Total Duration"等进行排序

(2)

Time. The total duration, from the start of the request to the receipt of the final byte in the response.

Waiting (TTFB). The browser is waiting for the first byte of a response. TTFB stands for Time To First Byte. This timing includes 1 round trip of latency and the time the server took to prepare the response.

Content Download. The browser is receiving the response.

"Content Download"的时间大于等于Time - Waiting (TTFB)的时间

五、查看请求依赖

To view the initiators and dependencies of a request, hold Shift and hover over the request in the Requests table.

DevTools colors initiators green, and dependencies red.

Reference:

1、https://developers.google.com/web/tools/chrome-devtools/network-performance/reference#timing

2、http://www.mamicode.com/info-detail-1015625.html

007_Chrome的Waterfall详解的更多相关文章

  1. CSS3之多列布局columns详解

    CSS3之多列布局columns详解 CSS3提供了个新属性columns用于多列布局.基本属性如下: 1. columns: <'column-width'> || <'colum ...

  2. Linq之旅:Linq入门详解(Linq to Objects)

    示例代码下载:Linq之旅:Linq入门详解(Linq to Objects) 本博文详细介绍 .NET 3.5 中引入的重要功能:Language Integrated Query(LINQ,语言集 ...

  3. 架构设计:远程调用服务架构设计及zookeeper技术详解(下篇)

    一.下篇开头的废话 终于开写下篇了,这也是我写远程调用框架的第三篇文章,前两篇都被博客园作为[编辑推荐]的文章,很兴奋哦,嘿嘿~~~~,本人是个很臭美的人,一定得要截图为证: 今天是2014年的第一天 ...

  4. EntityFramework Core 1.1 Add、Attach、Update、Remove方法如何高效使用详解

    前言 我比较喜欢安静,大概和我喜欢研究和琢磨技术原因相关吧,刚好到了元旦节,这几天可以好好学习下EF Core,同时在项目当中用到EF Core,借此机会给予比较深入的理解,这里我们只讲解和EF 6. ...

  5. Java 字符串格式化详解

    Java 字符串格式化详解 版权声明:本文为博主原创文章,未经博主允许不得转载. 微博:厉圣杰 文中如有纰漏,欢迎大家留言指出. 在 Java 的 String 类中,可以使用 format() 方法 ...

  6. Android Notification 详解(一)——基本操作

    Android Notification 详解(一)--基本操作 版权声明:本文为博主原创文章,未经博主允许不得转载. 微博:厉圣杰 源码:AndroidDemo/Notification 文中如有纰 ...

  7. Android Notification 详解——基本操作

    Android Notification 详解 版权声明:本文为博主原创文章,未经博主允许不得转载. 前几天项目中有用到 Android 通知相关的内容,索性把 Android Notificatio ...

  8. Git初探--笔记整理和Git命令详解

    几个重要的概念 首先先明确几个概念: WorkPlace : 工作区 Index: 暂存区 Repository: 本地仓库/版本库 Remote: 远程仓库 当在Remote(如Github)上面c ...

  9. Drawable实战解析:Android XML shape 标签使用详解(apk瘦身,减少内存好帮手)

    Android XML shape 标签使用详解   一个android开发者肯定懂得使用 xml 定义一个 Drawable,比如定义一个 rect 或者 circle 作为一个 View 的背景. ...

随机推荐

  1. MySQL中innodb_flush_log_at_trx_commit的设置

    innodb_flush_log_at_trx_commit=0,在提交事务时,InnoDB不会立即触发将缓存日志写到磁盘文件的操作,而是每秒触发一次缓存日志回写磁盘操作,并调用操作系统fsync刷新 ...

  2. Part-Seven

    1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12.

  3. Tooltip导致的无法访问已释放对象

    最近C#项目中遇到了一个无法访问已释放对象问题,经过反复测试,最终发现问题出在控件Tootip上,因为tootip内部有一个定时器,如果在窗口销毁时,鼠标移动到控件上恰好产生了一个tooltip,就会 ...

  4. nginx静态资源反向代理

    server { listen 80; server_name music.didi365.com; index index.php index.html index.htm; root /alida ...

  5. loj 10050 连续子段最大异或和

    #include<bits/stdc++.h> #define rep(i,x,y) for(register int i=x;i<=y;i++) using namespace s ...

  6. 【bzoj 3779】重组病毒

    Description 黑客们通过对已有的病毒反编译,将许多不同的病毒重组,并重新编译出了新型的重组病毒.这种病毒的繁殖和变异能力极强.为了阻止这种病毒传播,某安全机构策划了一次实验,来研究这种病毒. ...

  7. 哈希函数(hash函数)

    hash,—般译为“散列”,也可以直接音译为“哈希”,是对输入的任意长度(又称预映射),通过哈希算法,转换成固定长度的哈希值输出.这种转换是一种压缩映射,即,哈希值空间通常比输入空间小得多,不同的输入 ...

  8. 例:判断是不是自有属性hasOwnProperty方法

    自有属性和共有属性: 自有属性:直接保存在对象本地的属性 共有属性:保存在原型对象中,被所有子对象共享的属性 获取时:都可用对象.属性方法 赋值时:自有属性,必须:对象.属性 = 值 共有属性,必须: ...

  9. 用SQLAlchemy创建一对多,多对多关系表

    多对多关系表的创建: 如果建立好多对多关系后,我们就可以通过关系名进行循环查找,比如laowang = Teacher.query.filter(Teacher.name=='laowang').fi ...

  10. tensorflow开发基本步骤

    Tensorflow开发的基本步骤: 定义Tensorflow输入节点 通过占位符定义: X = tf.placeholder("float") 2.通过字典类型定义: input ...