How can I disable HTTP Keep-Alive in ASP.NET MVC?

前端 未结 4 623
青春惊慌失措
青春惊慌失措 2021-01-05 04:48

Is there a way to tell IIS/ASP.NET not to allow Keep-Alive for certain requests? Or even for an entire website, if that\'s really the only way to go about it?

4条回答
  •  悲&欢浪女
    2021-01-05 05:30

    If you really want to do this, adapt the IHttpModule in this answer to call Response.Close in the HttpApplication.EndRequest handler.

    “don’t use this API ever”

    more info on the ways to end a response...

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题