本文介绍了使用HTTP流水线的缺点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





  • Safari显然至少使用HTTP流水线技术来处理图像。



    总而言之,HTTP流水线的问题是:




    • 一些服务器& 不支持它。 (可能是出于安全性/可靠性/或性能问题)

    • 某些服务器支持错误,这可能导致客户端错误。

    • 它不是必然是一场表演胜利。

    • 易受阻挡线的影响


    WWDC 2012 session 706 - Networking Best Practices explains HTTP Pipelining.

    • By default its disabled on iOS
    • In the talk its described it as a huge performance win.

    Why might you not want to use it?

    解决方案

    Implementation bugs

    For pipelining to work, responses must come back in the order they were requested. A naive server implementation might just send the response as soon as it has been calculated. If multiple requests are sent in parallel, and the first request one takes longer to process (e.g. processing a larger image), then the responses will be out of order.

    This is a problem for the client since HTTP is a stateless protocol, the client has no way to match the requests with the responses. It is reliant on the order the responses came back in.

    Performance issues

    Even if the server does properly support pipelining, performance issues can arise because all subsequent requests have to wait for the first one to be complete (Head of Line blocking).

    So in summary the issues with HTTP pipelining are:

    • Some servers & most proxies don't support it. (Perhaps due to security / reliability / or performance concerns)
    • Some servers support it incorrectly and this can lead to client bugs.
    • It is not necessarily a performance win.
    • Susceptible to head of line blocking

    这篇关于使用HTTP流水线的缺点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 06:02