我目前有一些使用mod_rewrite(Apache 2.2)的Apache重写规则。
当我打开重写日志logging时,我看到许多对重写条件的重写条件的评估,这些重写条件不可能与重写条件匹配。
例如,如果我有一系列重写条件没有匹配我的文件/context/chet.js机会,我/context/chet.js应该用某种types的<Location>指令来包围整个块,当我知道的时候会绕过所有的RewriteCond他们都不会匹配来提高性能? 还是重写检查速度快,这样做是不值得的? 用像<Location>这样的指令进行预评估需要多less次重写检查?
[23/Sep/2013:12:04:31 --0400] (2) init rewrite engine with requested uri /context/chet.js [23/Sep/2013:12:04:31 --0400] (3) applying pattern '.*' to uri '/context/chet.js' [23/Sep/2013:12:04:31 --0400] (3) applying pattern '^/context/xyz' to uri '/context/chet.js' [23/Sep/2013:12:04:31 --0400] (3) applying pattern '^/context/abc123' to uri '/context/chet.js' [23/Sep/2013:12:04:31 --0400] (3) applying pattern '^/context/testService/(.*)$' to uri '/context/chet.js' [23/Sep/2013:12:04:31 --0400] (3) applying pattern '^/context/detect/(.*)$' to uri '/context/chet.js' [23/Sep/2013:12:04:31 --0400] (1) pass through /context/chet.js