Forum Moderators: phranque

Message Too Old, No Replies

What's faster? rewrite or setenvif?

What consumes less CPU?

         

motorhaven

2:08 am on Nov 1, 2006 (gmt 0)

10+ Year Member Top Contributors Of The Month



I have a large set of rewrite rules to catch bad bots and scrapers. I've done a lot of tweaking for speed such as an initial not condition that falls through only if the user agent is not a legit browser or search engine spider. This keeps the other conditions from being executed the vast majority of the time.

However, the testing that does occur when the legit agent test fails is quite intensive... about 250 or more tests. Would using setenvif be any faster than traditionaal rewrite conditional tests?

jdMorgan

3:24 am on Nov 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Would using setenvif be any faster than traditional rewrite conditional tests?

Probably not, since you'd have no way to skip the tests for legitimate user-agents as you describe.

I have not data to indicate which method would be faster in a straight comparison where no skip logic such as you describe was used. However, the results of your benchmark testing, should you choose to post them, would be most welcome here... :)

Jim