Using Application_BeginRequest for url rewriting


Up till now we've been rewriting URL's using a custon 404 page: the url would not map to any file in the site, and we configured the IIS to send 404 error to a aspx page which redirected those url's to the correct URL.
Now we want to stop using redirects, so after reading Scott Guthrie's article on Url Rewriting, I want to use the Application_BeginRequest in Global.asax. The thing is that a lot of our url's are not rewrites, and can get to the right place without any intervention. I'm worried that now every single request is going to have to go through the Application_BeginRequest method (even the un-rewritten url's), and I'm afraid it will slow down their loading time.
What do you think? Is loading time an issue when using Application_BeginRequest?

Best Solution

Every request goes through Application_BeginRequest anyway.

You'll need to add some logic so only those pages that need to be rewritten are changed.

That small bit of logic won't be very expensive.

I've used it, and didn't notice performance suffering at all.