IIS7 Integrated Mode - Bypass Forms Auth for static files

落花浮王杯 提交于 2019-12-10 17:27:08

问题


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?

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.

Any other ideas?


回答1:


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

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

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



来源:https://stackoverflow.com/questions/1942336/iis7-integrated-mode-bypass-forms-auth-for-static-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!