IIS7集成模式 - 不使用窗体身份验证的静态文件

问题描述:

我对使用窗体身份验证在集成模式下IIS7一个ASP.NET MVC应用程序。我注意到,ASP.NET运行时正在热播的每一个进来,即使它只是静态文件的请求(因为集成模式的可能)。是否有IIS7配置来提供静态文件没有击中ASP.NET的方式?

I have a ASP.NET MVC app on IIS7 using Forms Authentication in Integrated Mode. I am noticing that the ASP.NET runtime is being hit for every request that comes in even if it is only for static files (probably because of Integrated Mode). Is there a way to configure IIS7 to serve up static files without hitting ASP.NET?

我一直在想,解决这个问题的唯一方法是创建只是静态文件的一个单独的虚拟目录 - 如果你将一个迷你CDN,

I've been thinking that the only way around this is to create a separate virtual directory just for static files -- a mini-CDN, if you will.

任何其他的想法?

要避免您的HttpModule称为静态文件,在web.config中配置它使用 preCondition =managedHandler

To avoid having your HttpModule called for static files, configure it in web.config to use preCondition="managedHandler".

在情况下,它可以帮助,在Global.asax中的事件处理程序不调用静态文件。

In case it helps, event handlers in Global.asax are not called for static files.

此外,要知道,所有的HttpModules被要求的所有文件,当你与卡西尼测试。

Also, be aware that all HttpModules are called for all files when you're testing with Cassini.