Sunday, 14 July 2013

Performance Tip: ASP.NET HTTPResponse.Redirect(newURL, FALSE) is the way to redirect

Try to always use the second parameter endResponse for the method:

   HTTPResponse.Redirect(newURL, FALSE)

endResponse when set to true results in throwing the exception ThreadAbortException. Typically, exceptions propagations are expensive with respect to processing and results in performance degradation. Alternatively, it is recommended whenever possible to set endResponse to false and provide a graceful logical end to your thread following the redirection procedure.


Thanks goes to Mike Volodarsky's blog.
For details: MSDN

No comments:

Post a Comment