IIS 7.5:力保活报头中响应 [英] IIS 7.5: Force Keep Alive header in Response

查看:312
本文介绍了IIS 7.5:力保活报头中响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我的研究,IIS 7.5中不包括的连接:保持活动在其响应说明的原因的此处。不幸的是,我有一个不符合标准的客户端连接到我的网络服务,将无法再次使用插座,除非它看到的连接:保持活动的响应头。我试着编程方式将这个头,但IIS似乎有意剥离出来。有没有办法,我可以迫使这个头被送回我的淘气客户端?任何其他方式

Based on my research, IIS 7.5 doesn't include the Connection:Keep-Alive in its response for reasons described here. Unfortunately, I have a non conforming client connecting to my web service that won't reuse sockets unless it sees Connection:Keep-Alive in the response header. I've tried programmatically adding this header but IIS appears to purposely strip it out. Is there any other way that I can force this header to be sent back to my naughty client?

推荐答案

我打开了与微软的支持票就这个问题和有我最糟糕的怀疑证实。 IIS 7.5刻意prevents连接:保持活动标头从响应返回。按照HTTP 1.1 RFC,所有的连接应承担永葆(一个从出发HTTP 1.0)。因此,省略这个头是默认的,正确的(?)的行为。当保留是不可以可取的,IIS将发送连接:关闭页眉

I opened a support ticket with Microsoft on this and had my worst suspicions confirmed. IIS 7.5 deliberately prevents the connection:keep-alive header from being returned in the response. Per the HTTP 1.1 RFC, all connections should assume keep alive (a departure from HTTP 1.0). Therefore, the omission of this header is the default and correct (?) behavior. When keep-alives are not desirable, IIS will send the connection:close header.

但真正让我吃惊的是很大的篇幅到IIS会去到prevent这头被发送。在IIS管道带出这个头中的东西,不管它是如何加入。 (C#code在我的MVC应用程序,IIS管理器 - > HTTP响应头,IIS管理器 - > URL重写模块)。

What really surprised me is the great lengths to which IIS will go to to prevent this header from being sent. Something within the IIS pipeline strips out this header no matter how it is added. (C# code in my MVC application, IIS Manager-->HTTP Response Headers,IIS Manager-->URL Rewrite Module).

您会认为微软将允许某种在这个逃生阀,因为有这么多不符合HTTP 1.1客户端在野外,根本无法表现,除非他们看到这个标题。

You would think MS would allow some sort of escape valve on this, given that there are so many non-conforming HTTP 1.1 clients in the wild that simply will not behave unless they see this header.

这篇关于IIS 7.5:力保活报头中响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆