HTTP管线化

目录·实作
·External links




   




Schema of non-pipelined vs. pipelined connection.


HTTP 管线化 是将多个HTTP要求(request)整批送出的技术,而在传送过程中不需先等待伺服端的回应。管线化机制须透过永久连线(persistent connection)完成,仅 HTTP/1.1 支援此技术(HTTP/1.0 不支援),并且只有 GET 和 HEAD 要求可以进行管线化,而 POST 则有所限制。此外,初次建立连线时也不应启动管线机制,因为对方(服务器)不一定支援 HTTP/1.1 版本的协定。
浏览器将 HTTP 要求大批送出可大幅缩短页面的加载时间,特别是在传输延迟(lag/latency)较高的情况下(如卫星连线)。此技术之关键在于多个 HTTP 的要求讯息可以同时塞入一个 TCP 封包中,所以只送出一个封包即可同时发出多个要求,借此可减少网络上多余的封包并降低线路负载。



实作


实作在网页服务器
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 and reportedly 5.

实作在浏览器
Internet Explorer as of version 7 doesn''t support pipelining.
Mozilla Firefox 2.0 supports pipelining, but it''s disabled by default. It uses some heuristics, especially to turn pipelining off for IIS servers. Instructions for enabling pipelining can be found at Firefox Help: Tips & Tricks.
Konqueror 2.0 supports pipelining, but it''s disabled by default. Instructions for enabling it can be found at Konqueror: Tips & Tricks.
Opera has pipelining enabled by default. It uses heuristics to control the level of pipelining employed depending on the connected server. [1]

Implementation in web proxies
Most HTTP proxies do not pipeline outgoing requests, as demonstrated by this report.
Some versions of the Squid web proxy will pipeline up to two outgoing requests. This functionality has been disabled in the latest versions.
The Polipo proxy pipelines outgoing requests.

Other implementations
Some other applications currently exploiting pipelining are phttpget from FreeBSD (a minimalist pipelined HTTP client), portsnap (a FreeBSD ports tree distribution system) and lftp (a sophisticated file transfer program).

External links


HTTP/1.1 Pipelining FAQ at mozilla.org
"Network Performance Effects of HTTP/1.1, CSS1, and PNG" at w3.org
"Optimizing Page Load Times" article
phttpget
"Pipelining optimizations in Firefox"





自定义分类:
HTTP
 
贡献者:
leecb72
Copyright © 1999-2024 C114 All Rights Reserved | 联系我们 | 沪ICP备12002291号-4