HTTP管线化(HTTP pipelining)

默认情况下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://www.mzph.cn/news/410771.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

[html] 如果列表元素li的兄弟元素为div,会产生什么情况?

[html] 如果列表元素li的兄弟元素为div,会产生什么情况? 单纯的对html来说主要是破坏了语义结构吧, css方面来说不好统一控制样式,div默认也没有list-style个人简介 我是歌谣,欢迎和大家一起交流前后端知识。放弃很容易&#xf…

RFC函数的初步使用-同步

1、由于没有外围系统,采用不同SAP不同client之间进行测试。 首先在A-client搭建需要被调用的RFC函数。在A-client里运行SE37创建函数 在属性页签选择“远程启用的模块” 设定inport参数,传入人员名称去取usr21中的值 设定export参数,其中zper…

C# 繁体,简体互转

首先对Miscrosoft.VisualBasic类的引用. using Microsoft.VisualBasic; public static string Traditional2Simplified(string str) { //繁体转简体 return (Microsoft.VisualBasic.Strings.StrConv(str, Microsoft.VisualBasic.VbStrConv.Si…

[html] html的哪个标签可以预渲染?

[html] html的哪个标签可以预渲染? link 标签的 relpreload个人简介 我是歌谣,欢迎和大家一起交流前后端知识。放弃很容易, 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌谣一起通关前端面试题

2017蓝桥杯c语言C组承压计算,蓝桥杯2017Java B组---分巧克力and承压计算

分巧克力package lala;/**儿童节那天有K位小朋友到小明家做客。小明拿出了珍藏的巧克力招待小朋友们。小明一共有N块巧克力,其中第i块是Hi x Wi的方格组成的长方形。为了公平起见,小明需要从这 N 块巧克力中切出K块巧克力分给小朋友们。切出的巧克力需要…

HDU2138 随机素数测试 Miller-Rabin算法

题目描述 Give you a lot of positive integers, just to find out how many prime numbers there are.. In each case, there is an integer N representing the number of integers to find. Each integer won’t exceed 32-bit signed integer, and each of them won’t be …

[html] 你写一个页面需要多长时间?

[html] 你写一个页面需要多长时间? 和页面结构,样式,交互设计正相关个人简介 我是歌谣,欢迎和大家一起交流前后端知识。放弃很容易, 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌谣一起通关前端面试题

Android编程获取手机型号,本机电话号码,sdk版本及firmware版本号(即系统版本号)...

Android开发平台中,可通过TelephonyManager 获取本机号码。 TelephonyManager phoneMgr(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);txtPhoneNumber.setText(phoneMgr.getLine1Number()); //txtPhoneNumber是一个EditText 用于显示手机号注…

vba copy sheet

Sub copySheet() Dim wkbk As Workbook Set wkbk Workbooks.open("源文件.xls") 先打开要复制的文件 wkbk.sheets(1).Copy thisworkbook.sheets(1) 再将此文件中第一个工作表复制到当前工作簿的第一个工作表前 End Sub 这样是最简单的代码了,但是有些限制…

Android仿ios二级菜单侧滑,仿IOS的列表项滑动菜单——ListItemMenu

一个简单的仿IOS的列表项滑动菜单(也不知道怎么描述比较好)。顺手做出来的小东西,就分享给大家了。仿iOS列表项滑动菜单:1、滑动出现菜单,越界阻尼效果;2、删除列表项效果。GitHub地址:https://github.com/zarics/ListItemMenu1.[代码]布局示…

[html] 你认为一个好的布局应该是什么样的?有哪些需要注意的地方?

[html] 你认为一个好的布局应该是什么样的?有哪些需要注意的地方? 先布局整体,再细分到模块; 先抽离组件再分离业务个人简介 我是歌谣,欢迎和大家一起交流前后端知识。放弃很容易, 但坚持一定很酷。欢迎大家一起讨论 主目录 与…

判断cloudblob是否存在

这是开博的第一篇,还要废话一下。我写的很多内容都是网上找资料然后自己总结出来的,原出处已经很难找到了,所以不会标出引用的内容。如果侵犯到您的版权,请和我联系,我会删改相关的内容。 cloudblob 是azure blob的一个…

android studio炸包怎么导入,请问android studio如何引入包

梦里花落0921jar包放项目根目录libs文件夹右键选择Add As Library"剩选项默认行点击。Show import popup,这个是用于编辑XML时,自动会弹出一个import的对话框,问你是否需要导入。JavaInsert imports on paste:(All Ask None),这个其实就…

[html] button标签的type默认值是什么呢?

[html] button标签的type默认值是什么呢? Internet Explorer 的默认类型是 "button",而其他浏览器中(包括 W3C 规范)的默认值是 "submit"。个人简介 我是歌谣,欢迎和大家一起交流前后端知识。放…

Java 理论与实践:让 J2EE 脱离容器

大多数项目不是属于 J可以存在于 J2EE 容器之外Goetz 分析如何在 J2SE 应他读者分享您关于本文的心2EE 应用程序就是属于 J2SE 应,并且有些 J2SE 应用程序可以用程序中使用某些 J2EE 服务。得。(您也可以单击文章顶部或用程序。不过,有一些 J…

eclipse IDE中無法打開android模擬器

转帖:http://blog.csdn.net/wang_shaner/article/details/6784852 错误提示为: invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.Hint: use foo to launch a virtual device named foo.please use -help for more in…

[html] H5的哪些特性需要https支持呢?

[html] H5的哪些特性需要https支持呢? service workers个人简介 我是歌谣,欢迎和大家一起交流前后端知识。放弃很容易, 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌谣一起通关前端面试题

android view rotate,Android使用RotateImageView 旋转ImageView

废话不多说了,直接给大家代码。具体代码如下所示:package com.droidhen.game.layout;import android.content.Context;import android.graphics.Bitmap;import android.graphics.Bitmap.Config;import android.graphics.Canvas;import android.graphics.…

传惠普CEO李艾科将部署全新战略计划

北京时间1月15日消息,据知情人士透露,惠普新任CEO李艾科(Leo Apotheker)即将完成一项战略计划,包括重组管理层,以及将更多精力放在利润率更高的业务上。 知情人士表示,这些计划包括向软件、网络和存储业务投入更多资源…

[html] 请使用canvas画一个渐变的长方形

[html] 请使用canvas画一个渐变的长方形 // 普通canvas绘图工具类// umd适配多种引入方式 (function(root, factory) {if (typeof define function && define.amd) {// AMDdefine([CanvasTool], factory);} else if (typeof exports object && typeof modul…