View Full Version : Overhead for .htaccess files
MPaul
05-19-2005, 10:27 PM
I use .htaccess files a lot, but usually only for redirecting files that I've moved. During my last redesign, I had quite a few of files that moved, so my .htaccess file was kinda big (50 lines or so). Now that I'm redesigning again, restructuring some stuff and using WordPress, I'll also be using RewriteRules.
Since the .htaccess get parsed at every request that is made to the server, what's the overhead for them?
Arthur
05-20-2005, 04:01 AM
Since the .htaccess get parsed at every request that is made to the server, what's the overhead for them? It depends on what you mean by "what's the overhead". There will certainly be a performance hit when using mod_rewrite, but it's very difficult to quantify it.
Arthur
MPaul
05-20-2005, 09:44 AM
With overhead a meant if it would somehow affect the server's performance.
Andilinks
05-20-2005, 11:39 AM
I've thought about this often when I deny access to spambots. Certainly with every page served the .htaccess file must be read at least. If it is a simple comparison of IP numbers it would equal the size of the file times two. A redirect would cost more overhead but not much.
With more complex processing with mod_rewrite I think a simple "seat-of-the-pants" look at the complexity is best, for instance if pages seem to load slowly.
I have decided that with spambots, most of them hit once and never return so no matter how piggish they are I don't ban them unless they return more than once in one day--so as to avoid this overhead with the .htaccess file.
Andi
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.