Depending on what you are doing, I would not expect to see a significant improvement over using HttpHandler. I would start by simply writing an HttpHandler and seeing how it works. If you want this to be faster, try looking more closely at what you are actually doing, processing the request and seeing what can be optimized. For example, if you are logging in a database, try writing to a local database, not through a network. If it is still not fast enough, then perhaps consider writing something at a lower level. Until now, however, I would have kept it easier for you to write.
For reference, I wrote an ad server in ASP.NET (using HttpHandlers), which can display an ad (including targeting and record impressions in a local database) in the 0-15 ms mode at boot time. I thought I was doing quite a bit of processing, but this is a pretty good IMHO response time.
Update after a few months :
If you clear all the HttpModules that are enabled by default, this will reduce the amount of overhead. By default, the following HttpModules are included on each site through a machine-level web.config file:
- OutputCache
- Session (for session state)
- WindowsAuthentication
- FormsAuthentication
- Passportauthentication
- Rolemanager
- Urlauthorization
- Fileauthorization
- AnonymousIdentification
- Profile
- Errorhandler
- ServiceModel
As I said above, my ad server does not use any of them, so I just did this in this web.config application:
<httpModules> <clear /> </httpModules>
If you need some of them, but not all, you can remove those that you do not need:
<httpModules> <remove name="PassportAuthentication" /> <remove name="Session" /> </httpModules>
ASP.NET MVC Note: . ASP.NET MVC requires a session state module if you are not doing something specific to circumvent it. See this question for more information: How to disable session state in ASP.NET MVC?
Update for IIS7: Unfortunately, everything is not so simple in IIS7. Here's how to clear HTTP modules in IIS7
Daniel Schaffer Feb 04 '09 at 3:53 2009-02-04 03:53
source share