Performance impact of rewrite conditions?

Posted by makeee on Stack Overflow See other posts from Stack Overflow or by makeee
Published on 2010-04-13T07:41:18Z Indexed on 2010/04/13 7:42 UTC
Read the original article Hit count: 273

Filed under:

My web framework (cakephp) uses the following rewrite conditions and rule:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

I serve up a lot of image files (~10 a second). I'm wondering if it would improve performance to have a rewrite rule that exempted requests for files in my images directory from even trying those rewrite conditions (checking whether the file exists). My traffic is constantly fluctuating, so this would be hard to benchmark, which is why I thought I'd ask here.

If that would be beneficial, how might I exclude files in "/images" directory from trying those conditions and rewrite rule?

© Stack Overflow or respective owner

Related posts about mod-rewrite