Page is a not externally linkable
jdMorgan - 10:28 pm on Feb 7, 2005 (gmt 0)
For example, *all* AOL users. > If we have multiple RewriteCond statement, does the order we list the domains matter? Did images.google.com RewriteCond statement come before 213.239.xx.xx because that would reduce processing time? The doamin is listed first because I see rquests from the domain more often than I see requests from the IP address. Try to make your RewriteRule pattern as specific and exclusive as possible. If the pattern match in RewriteRule fails, no RewriteConds will be processed, which save time. Then put the RewriteConds in order from [most-likely to fail and fastest to process] to [least-likely to fail and slowest to process]. Generally, RewriteConds testing back-references and server variables are fastest. RewriteConds testing file-exists or directory-exists must query the filesystem and are therefore slower. The slowest RewriteCond is testing %{REMOTE_HOST}, because this invokes a reverse-DNS request; Your server must send a request to the domain name system and await a response before the current transaction can proceed. Avoid this at all costs, and in unavoidable, try to make this happen as infrequently as possible by writing specific RewriteRule and RewriteCond patterns, and by putting the %{REMOTE_HOST} test last in the list of RewriteConds. I should point out that if you run a database-driven site, it's unlikely that you'll notice much difference in optimizing mod_rewrite code; Database query time will likely swamp out any gains from optimizing mod_rewrite. The same is true to a lesser extent if you run complex php or php scripts -- or any server-side scripts for that matter. Just for reference, I have a site with a 35kB .htaccess file. I readily admit this is excessive, and I've been paring it down recently, now that the bad guys have figured out they can't steal anything without getting banned and reported and are starting to leave me alone. But the fact is that there is no noticeable difference in site performance when this big .htaccess file is enabled or disabled; The other site factors are much more important to performance. At the same time, I believe making whatever code I've got run as efficiently as possible when I write it, even if there is a *lot* of it. So it's a balance; Try to write efficient code, but don't beat yourself to death trying to fine-tune everything... The computers are supposed to work for us, not the other way around! ;) Jim
> then anyone who comes to your page with such a firewall will not see images...