SetEnvIf vs mod_rewrite

#1
In a configuration that is required to globally (server-wide) set environment variables (such as noabort) against requests matching at least 2 conditions (such as: https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:php:run-without-timeouts):

Question: Which would provide the best performance: SetEnvIf or mod_rewrite

Worth noting that SetEnvIf has no support logical operators, it needs convoluted configurations in order to achieve a logical AND (eg. 6 SetEnvIf lines to achieve a single logical AND).
 

NiteWave

Administrator
#2
performance wise, there is no difference I think.
it looks like SetEnvIf can be regarded as a subset of mod_rewrite(though I haven't researched about it at the moment). maybe sometimes SetEnvIf is easier to understand, so it's not bad to have another choice for the user.
 
#3
Thanks, that's the feeling I had too, though was hoping someone could offer a more definitive insight - would that be possible?
 

Pong

Administrator
Staff member
#4
We did not test performance against them. You can run your own benchmark test. To me, should be the same.
 
Top