Does htaccess RewriteCond affect performance?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
userok's picture

Hi, Performance issues aren't really my forte:

background info:
My test site is geared to anonymous only, and thus have Boost. Each node has a cck field so that users can type in a word eg. "DOG". I've hotlinked an image url to automatically include that cck word - eg. http://mysite/images/DOG.jpg. This allows me the choice to easily upload a picture or not. Obviously a 'broken image' icon appears if no pic is uploaded.

To resolve the 'broken link' ugliness I've come across something like:

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^images/.*.jpg$ /images/blank.jpg [L]

The above will enable me to substitute the 'broken image' icon with an image of my own.

My questions:
1) will the Rewrite conditions have significant performance impacts if there are 15 thousand (or more!) missing images?
2) will the Rewrite conditions affect Boost or any other caching systems?

thanks!

Comments

Reducing 404's will be faster

mikeytown2's picture

Core issue
http://drupal.org/node/76824

"Standard" way to do it in D6
http://2bits.com/drupal-planet/reducing-server-resource-utilization-busy...

1) Significant performance impacts as the load on your server will be lower (a good thing)
2) Very unlikely as long as you keep it outside of the boost section. Place it above or below but not in the middle of it.

thanks for replying

userok's picture

...it's good to hear that I can use this solution. I'll read up on your other solution too. cheers.