在Windows身份验证的asp.net MVC应用程序的所有资源(2×401.2和1×200)3请求 [英] 3 requests for every resource (2 x 401.2 and 1 x 200) in a windows authenticated asp.net mvc app

查看:118
本文介绍了在Windows身份验证的asp.net MVC应用程序的所有资源(2×401.2和1×200)3请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图追查为什么我的网站是如此IE9十分缓慢,当我拿出小提琴手,并意识到,每个请求被发送3次(两次我得到401.2,然后是成功的)。我证实了这一发生在所有的浏览器,它只是Chrome的速度掩盖这个(或它可能是,这已经无关,与我的网站在IE浏览器的性能问题)。

I was trying to track down why my site was so painfully slow in IE9 when I pulled out Fiddler and realised that every request is being sent 3 times (twice I get 401.2 and then a success). I verified this happens on all browsers, its just that Chrome's speed was masking this (or it could be that this has nothing to do with my sites performance issues in IE).

我在我的开始/结束请求处理程序设置断点和请求进入说一个CSS文件。它没有被认证和响应熄灭了401.2,我检查了一倍,我不是设置响应状态的任何地方我自己,所以地方begin_request和END_REQUEST状态被改变为401.2之间

I've set up break points in my begin/end request handlers and the request comes in for say a css file. It is not authenticated and the response goes out with a 401.2, I doubled checked that I'm not setting the response status anywhere myself, so somewhere between begin_request and end_request the status is changing to 401.2

注:我有runAllManagedModulesForAllRequests = true,所以我可以配置COM pression,但是这设置不影响本(从我可以从小提琴手看到)

Note: I have the runAllManagedModulesForAllRequests=true so I can configure compression, however this setting does not affect this (from what I can see from Fiddler).

我Kerberos的/ Active Directory的一般很无知,但我就是无法捉摸,这是对每一个请求正常的握手协议(也许是第?但不是全部)。

I am very ignorant on kerberos/active directory in general but I just cannot fathom that this is a normal handshaking protocol for every single request (perhaps for the first? but not all).

我已经走遍了谷歌和似乎没有任何帮助(添加/删除模块/验证提供者等)。我的意思是我的网站工作得很好,只有一次你,我看到了treplicated请求引擎盖下看它。注:当我部署到生产这也发生所以它不是一个服务器的特定问题。

I have scoured the googles and nothing seems to help (adding/removing modules/authentication providers, etc). I mean my site works just fine, its only once you look under the hood that I see the treplicated requests. Note: This also happens when I deploy to production so its not a server specific issue.

有没有人见过这个?先谢谢了。

Has anyone ever seen this? thanks in advance.

推荐答案

我觉得这是多么NTLM身份验证工作。该过程讨论<一href=\"http://blogs.msdn.com/b/saurabh_singh/archive/2010/01/06/case-study-are-you-seeing-401-s-too-often-for-http-web-requests.aspx\"相对=nofollow>此处。请注意,您将要AuthPersistSingleRequest设置为false,以减少401S数

I think this is how NTLM authentication works. The process is discussed here. Note that you will want to set AuthPersistSingleRequest to false to cut down on the number of 401s

这篇关于在Windows身份验证的asp.net MVC应用程序的所有资源(2×401.2和1×200)3请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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