views:

260

answers:

3

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?

A: 

See the 2nd response in this thread.

RandomNoob
Thanks. I should have been more direct with this question. The root of the problem is that the Application_AuthenticateRequest() method is being run on requests for static files. Would your suggested solution solve this problem?Sorry, I'm not able to test it right now because I don't have access to a box with IIS7 on it at the moment.
Andrew Young
And I don't want Application_AuthenticateRequest() to be run for static files.
Andrew Young
We are encountering the same situation. Andrew, did you ever find a solution?
Ryan Riley
A: 

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.

RickNZ
A: 

I think you might find this article interesting:

Creating Static Content Website in IIS 7

Lucifer