默认情况下http协议中每个传输层连接只能承载一个http请求和响应,然后结束。

HTTP是一个简单的协议。客户进程建立一条同服务器进程的 T C P连接,然后发出请求并读取服务器进程的响应。服务器进程关闭连接表示本次响应结束。服务器进程返回的文件通常含有指向其他服务器上文件的指针(超文本链接)。用户显然可以很轻松地沿着这些链接从一个服务器到下一个服务器。

HTTP管线化

HTTP管线化是将多个HTTP要求(request)整批提交的技术,而在传送过程中不需先等待服务端的回应。管线化机制须通过永久连接(persistent connection)完成,仅HTTP/1.1支持此技术(HTTP/1.0不支持),并且只有GET和HEAD要求可以进行管线化,而POST则有所限制。此外,初次创建连接时也不应启动管线机制,因为对方(服务器)不一定支持HTTP/1.1版本的协议。

浏览器将HTTP要求大批提交可大幅缩短页面的加载时间,特别是在传输延迟(lag/latency)较高的情况下(如卫星连接)。此技术之关键在于多个HTTP的要求消息可以同时塞入一个TCP分组中,所以只提交一个分组即可同时发出多个要求,借此可减少网络上多余的分组并降低线路负载。


[摘自W3C]

在永久连接或者HTTP pipelining出现之前,每个连接的获取都需要创建一个独立的TCP连接。

Prior to persistent connections, a separate TCP connection was established to fetch each URL, increasing the load on HTTP servers and causing congestion(拥塞) on the Internet.

[摘自维基百科]

HTTP pipelining可以吧多个http请求输出到一个socket连接(倘若是基于socket的话,更确切的说应该是输出到一个传输层连接,在tcp ip中即为TCP连接)中去,然后等到对应的响应。

HTTP pipelining is a technique in which multiple HTTP requests are written out to a single socket without waiting for the corresponding responses. Pipelining is only supported in HTTP/1.1, not in 1.0.
   
    The pipelining of requests results in a dramatic improvement in page loading times, especially over high latency connections such as satellite Internet connections.
   
    Since it is usually possible to fit several HTTP requests in the same TCP packet, HTTP pipelining allows fewer TCP packets to be sent over the network, reducing network load.
   
    Non-idempotent(非幂等) methods like POST should not be pipelined. Sequences of GET and HEAD requests can be always pipelined. A sequence of other idempotent requests like GET, HEAD, PUT and DELETE can be pipelined or not depending on whether requests in the sequence depend on the effect of others.[1]
   
    HTTP pipelining requires both the client and the server to support it. HTTP/1.1 conforming servers are required to support pipelining. This does not mean that servers are required to pipeline responses, but that they are required not to fail if a client chooses to pipeline requests.

Implementation in web servers

Implementing pipelining in web servers is a relatively simple matter of making sure that network buffers are not discarded between requests. For that reason, most modern web servers handle pipelining without any problem.
    Exceptions include IIS 4.

Implementation in web browsers

HTTP pipelining is disabled in most browsers.
    Opera has pipelining enabled by default. It uses heuristics to control the level of pipelining employed depending on the connected server.
    Internet Explorer 8 does not pipeline requests, due to concerns regarding buggy proxies and head-of-line blocking.
    Mozilla browsers (such as Mozilla Firefox, SeaMonkey and Camino), support pipelining however it is disabled by default.It uses some heuristics(测试试探), especially to turn pipelining off for IIS servers. does the same thing as Firefox.
    Konqueror 2.0 supports pipelining, but it's disabled by default.
    Google Chrome does not support pipelining.

Implementation in web proxies
    Most HTTP proxies do not pipeline outgoing requests.
    Some versions of the Squid web proxy will pipeline up to two outgoing requests. This functionality has been disabled by default and needs to be manually enabled for "bandwidth management and access logging reasons."Squid supports multiple requests from clients.
    The Polipo proxy pipelines outgoing requests.

转载于:https://www.cnblogs.com/dongzhiquan/archive/2011/01/03/1994525.html

HTTP管线化(HTTP pipelining)相关推荐

  1. (chap2 简单的Http协议) HTTP性能优化之管线化pipelining

    在长连接的基础上,为了解决阻塞请求问题,HTTP1.1进一步地支持在持久连接上使用管道化(pipelining)特性,这是相对于keep-alive连接的又一性能优化. 1. 管线化概念 之前需要发送 ...

  2. Http的持久连接和管线化

    [要点] 1. 什么是持久连接? 2. 什么是管线化? [总结] 1.什么是持久连接? (keep alive模式) HTTP1.1规定了默认保持长连接(HTTP persistent connect ...

  3. 存储http请求返回参数_前端学习需要知道的 HTTP 知识(1/7)

    基础知识 场景 我们打开浏览器,输入网址(比如 https://www.bilibili.com/),然后我们就可以看到 b 站的 Web 页面,Web 页面当然不能凭空显示出来.根据 Web 浏览器 ...

  4. 关于 Http 协议,你必须要知道的

    引言 HTTP协议是Hyper Text Transfer Protocol(超文本传输协议)的缩写,是用于从万维网服务器传输超文本到本地浏览器的传送协议.HTTP 是基于 TCP/IP 协议通信协议 ...

  5. HTTP(2)----图文解析HTTP

    先扒一扒HTTP协议背景? HTTP(HyperText Transfer Protocol) 即超文本传输协议,现在基本上所有web项目都遵从HTTP协议(协议就是一种人为的规范). 目前绝大部分使 ...

  6. TCP/IP基础总结性学习(2)

    简单的HTTP协议 一.HTTP 协议用于客户端和服务器端之间的通信 客户端和服务器的定义:请求访问文本或图像等资源的一端称为客户端,而提供资源响应的一 端称为服务器端.在两台计算机之间使用 HTTP ...

  7. 图解传说中的HTTP协议

    先扒一扒HTTP协议背景? HTTP(HyperText Transfer Protocol) 即超文本传输协议,现在基本上所有web项目都遵从HTTP协议(协议就是一种人为的规范). 目前绝大部分使 ...

  8. 《图解HTTP》全文笔记梳理

    因为考研初试复习计网时总感觉要记忆的知识点比较多,协议特别多,更要命的是总有一种串不起来的感觉.当时因为时间紧迫,就只看了王道的参考书,正因为这种书"过于应试"所以很多地方不知所以 ...

  9. 《图解HTTP》摘录

    # 图解HTTP 第 1 章 了解Web及网络基础 1.1使用http协议访问web 客户端:通过发送请求获取服务器资源的Web浏览器等. Web使用一种名为 HTTP(HyperText Trans ...

最新文章

  1. DL之DNN:自定义2层神经网络TwoLayerNet模型(封装为层级结构)利用MNIST数据集进行训练、预测
  2. HBase Error IllegalStateException when starting Master: hsync
  3. P4321-随机漫游【状压dp,数学期望,高斯消元】
  4. 小米手机又一产品线退场,大步迈向高端市场!
  5. 移动app测试的多样性_移动App测试一些崩溃原因及触发崩溃的场景
  6. 【安装配置】SAS9.4安装
  7. 安徽庐江:副副春联送祝福 浓浓墨香迎新春
  8. echarts 柱状图颜色设置
  9. Redis 中的 standalone(单机模式)配置说明和分析
  10. 【推荐】到伊甸园玩体感游戏吧!
  11. Android(Linux) led子系统分析
  12. 数据从网卡到应用的过程
  13. iOS 支持3DTouch快捷菜单
  14. 51单片机检测温湿度并且上传到阿里云
  15. git中push和pull的区别是什么
  16. 轻流入选 Forrester 中国制造商通过低代码加速价值交付案例研究报告
  17. 越狱第一季 英文表达总结(部分)
  18. 西行漫记(4):周末
  19. 我们文本分析了贾跃亭2017年全部公开信,发现他近期喜欢用“责任”“致歉”...
  20. 小彩灯特效 html+css

热门文章

  1. c#扫描图片去黑边(扫描仪去黑边)
  2. Fiddler简介及安装和HTTPS的解决
  3. Java面试常见算法
  4. 阿里云天池 金融风控训练营Task1 广东工业站
  5. 第四章 大网高级   NSSA
  6. 常用命令-tar 加密
  7. DHCP服务开启了,为什么老是网络冲突
  8. linux-shell面试题 之二
  9. 6月份美国域名总量新增近5.4万个 环比减少51%
  10. 数据开放 数据集_除开放式清洗之外:叙述是开放数据门户的未来吗?