locked
Is this a good candidate for an HTTP Handler ? RRS feed

  • Question

  • User1694528010 posted

    Hi everyone,

    I have an .aspx page that essentially simply does page redirect based on various parameters that are passed on to it, but it's the most often accessed page on the entire site.  I just do a Response.Redirect in the PreRender event based on those parameters.  I was thinking whether or not this would be a good candidate for a custom HTTP Handler.  Will I see any performance increases by doing so ?

    Any feedback would be much appreciated.

    Thank you.

    Tuesday, September 19, 2006 12:48 PM

Answers

  • User-1630302068 posted
    Actually I think that sounds like a good candidate for a URL rewriting HttpModule.  With URL rewriting you silently do the redirect on the server which saves a round trip to the client.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 20, 2006 8:27 AM
  • User1750964609 posted
    Also HttpHandler provides direct way to URL rewriting
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 21, 2006 1:13 AM
  • User-1688778083 posted

    Hi.

    Independently the solution you adopt (URL rewrite or client redirection), this is a typical situation to implement an ASP:NET HTTP handler. However, should I remember you a possible problem with URL rewriting if, for instance, you want clients to know the real URL they are accessing, for example to save them in bookmarks. In this situation the content returned is the one you want, but the URL on the client will remain the same.

    As far as performance is concerned, the gains on this approach are significant (more notorious if this is a heavy loaded site).

    If you adopt the redirect solution, by implementing this logic in a module you intercept the request at the beginning of the pipeline, avoiding the unnecessary processing time to complete the remaining steps till the PreRender event in the aspx handler. If you use URL rewriting (see here a good example of this solution) you avoid the unnecessary handler creation (the aspx that does the redirection).

    Independently the solution you adopt, this is a situation where the HTTP module seams the right way to do it.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 22, 2006 3:47 PM

All replies

  • User-1630302068 posted
    Actually I think that sounds like a good candidate for a URL rewriting HttpModule.  With URL rewriting you silently do the redirect on the server which saves a round trip to the client.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 20, 2006 8:27 AM
  • User1694528010 posted
    Thank you for the feedback.  I'll give that a shot.
    Wednesday, September 20, 2006 7:23 PM
  • User1750964609 posted
    Also HttpHandler provides direct way to URL rewriting
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 21, 2006 1:13 AM
  • User-1688778083 posted

    Hi.

    Independently the solution you adopt (URL rewrite or client redirection), this is a typical situation to implement an ASP:NET HTTP handler. However, should I remember you a possible problem with URL rewriting if, for instance, you want clients to know the real URL they are accessing, for example to save them in bookmarks. In this situation the content returned is the one you want, but the URL on the client will remain the same.

    As far as performance is concerned, the gains on this approach are significant (more notorious if this is a heavy loaded site).

    If you adopt the redirect solution, by implementing this logic in a module you intercept the request at the beginning of the pipeline, avoiding the unnecessary processing time to complete the remaining steps till the PreRender event in the aspx handler. If you use URL rewriting (see here a good example of this solution) you avoid the unnecessary handler creation (the aspx that does the redirection).

    Independently the solution you adopt, this is a situation where the HTTP module seams the right way to do it.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 22, 2006 3:47 PM