Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Http Modules :: how to bypass the standard ASP.NET pipeline behaviourHttp Modules :: how to bypass the standard ASP.NET pipeline behaviour
Previous
 
Next
New Post
5/1/2007 8:25 AM
 

I am currently working on a standalone (Adobe)Flash chat Client that, similar to Michael Washington's IWeb Module, talks to a DNN hosted aspx-page (the Gateway), that again returns the data as a well formed XML document.

Here, when it comes to performance, I am not happy of being forced to run through all the ASP.NET pipeline that triggers many things I do not need and therefore will unnecessarily throttle overall DNN performance.
So the question here is, whether there is a way to control the pipeline, or at least, whether there is an option to bypass certain HTTP Module handlers for some exceptional requests. Best would be to have a way for telling a single aspx page which HTTP Modules (and only those) to execute.

What worries me even more than just the performance issue, is, that anybody, anytime might add HTTP Modules to the pipeline that might have an even worse impact on my Gateway's function, respectively the well defined XML-Response it generates ( in my case - the response always needs to comply with a client side *.xsd definition file).

Currently I see the following options to deal with this:

1. Defensive
I am not sure whether the Core Team should be aware, that with an upcoming need for web-services, AJAX-requests and other types of "callbacks", adding more and more functionality (and "if" statements) to the pipeline might significantly impact overall performance. Here I suggest to eiterh put "global functions" somewhere else (something that can be dynamically switched on or off), or to provide a hook to unregister or bypass HttpModule Handling for specific Requests.

2. Radical
Ignore DNN completly and get the data from the native Database. Although this migth be the most performant solution, it is disastrous from an administrative and security point of view (e.g. managing security at two places).

3. LowLevel
Bypass IIS and call the dlls directly (RPC). Might be a good solution for some individually customized installations, but not very useful in a world that increasingly builds on the web.

4. Dedicated Gateway Marker
It might be a good idea to specify a path- or file-name or some other type of marker for the identification of facade items (such as an aspx page) that will be ignored by all standard DNN HttpModules.
So what I have in mind in some kind of "if  (URL == Marker) then exit" clause to be used in every HttP Handler's init() function.

Any other ideas ?

 
New Post
5/1/2007 9:10 AM
 

You could write your own handler (*.ashx) to return your xml. At least you will bypass some of the code that is run by asp.net when executing aspx files


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
5/1/2007 11:34 AM
 

yes, writing my own Http Handler might be an option that falls in the Nr. 4 categorie of alternatives, as the *.ashx extension provides a "hook", that might easily be used in the DNN Http Modules to treat Http Handlers differently.
However this does not solve the pipeline issue, as the current  DNN Version 4.5.1 standard Http Modules (e.g. UrlRewrite-, Personalization-  and DNNMembershipModule) are still fired when calling an *.ashx file as well.
Further we might face some challenges when installing our own Http Handler as this

a) requires the web.config to be changed (some risks for the non experience users, and eventually even a no-go for large environments, where the DNN application must not be restarted).

b) would require all DNN Hosters to allow HTTP Handlers (*.ashx) to pass IIS (which some might not do as some older DNN versions did not need *.ashx files in the past).  

Concerning performance writing my own HttpHandler might be in general a faster option than writing an ASPX-page or a WebService (*.asmx) - here you are right - but concerning the pipeline issue it's all the same, I guess.

 
New Post
5/1/2007 4:06 PM
 

Writing a handler won't solve a basic problem with ASP.Net.  In the Asp.Net architecture, HTTP Modules are intended to fire for EVERY request, regardless of the HTTPHandler that is responsible for handling a given request.  In many cases, HTTPModules provide base services and can only be coded as modules since that is the only place to hook basic pipeline events.

So let's look at the default HTTPModules

  1. Compression - This module already has a mechanism for bypassing the processing.  Just add your page to the exclusion list.
  2. URLRewrite - This module is critical since it controls basic security functions and detects which portal a given request should be mapped to.  This is a module that should not be bypassed.  Even if you disable URLRewriting, portions of this module must still run for basic system security.
  3. Exception - This module only listens to the error event in which case the error is logged.  This is only triggered if your app does not catch and handle the error in it's own code.  So as long as you properly handle your own errors, there is virtually no processing occuring here (beyond adding the event handler to the pipeline).
  4. UsersOnline - This module is not critical and by default is turned off in most sites.  However, if enabled it will process on every request.
  5. DNNMembership - This module is critical for loading the PortalSettings object, however it is automatically bypassed for all requests that are not aspx, ashx and asmx.  Without PortalSettings much of the DNN API would not function.  So bypassing this module should never be done.
  6. Personalization - This module is only used to save user data in their profile.  It is not heavily used at the moment and could be safely bypassed.  It might make sense in the future to move this into the BasePage class so that every webservice and non-dnn specific page could choose to participate or not depending on their inheritance chain.
  7. ScriptModule - This is needed to enable Asp.Net Ajax for the site and is not coded by DNN.

 As you can see, there are only one or two modules that affect performance and which could be safely bypassed.  More importantly you can never be sure that a user won't add new HTTPModules to their application.  Like every application developer, you can only control your own code, and provide the end-user the information needed for them to configure their computer environment appropriately to get optimal performance of your application.  If they install your app, and then install a bunch of extra modules which bogs down processing then that is their problem.  To me this is not any different than a user deciding to run their website on SQL Express or to use that old P4 box that they still had left over from Y2K.


Joe Brinkman
DNN Corp.
 
New Post
5/1/2007 5:48 PM
 

I looked into this myself about 6 months ago, and came up with the same conclusion, because you're not using an aspx page, when it comes down to it there is actually very little performance cost.

Chances are if you do take the time to remove a bunch of processing you're going to wish you didn't...  are you going to want to have your chat application have access to the user roles that the logged in user has access to?

Any chat application happening over HTTP is going to be a big resource expense - not only at the server end, but at the client end because of the constant poling.

There is a WHOLE lot taking place that you don't even see for each web request already...  making binary decisions and creating small objects in memory isn't nearly as resource intensive as doing things like polling a database - network traffic and disk access are the major culprits of performance on web applications.  Overall, the memory footprint on DotNetNuke isn't that bad.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Http Modules :: how to bypass the standard ASP.NET pipeline behaviourHttp Modules :: how to bypass the standard ASP.NET pipeline behaviour


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out