How big can .htaccess be before decreasing site loading speed?

Discussion in 'Apache' started by AKnogood, Aug 2, 2010.

  1. #1
    How many RewriteRules can I put into my .htaccess before decreasing my site performances?
     
    AKnogood, Aug 2, 2010 IP
  2. zacharooni

    zacharooni Well-Known Member

    Messages:
    346
    Likes Received:
    20
    Best Answers:
    4
    Trophy Points:
    120
    #2
    If it takes you more than 5 minutes to read through what it does, it's probably too long. If you have a bunch of Deny rules, you may want to consider putting it in it's own custom .conf file included in the VirtualHost block. That way it will be in memory, and not have to load every time to parse rules.
     
    zacharooni, Aug 3, 2010 IP
  3. CoderJosh

    CoderJosh Peon

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    .htaccess decreases the performance just because the web server looks for that file and opens that file for each and every request. So for best performance, you'd indeed have to put everything in the Apache configuration and configure "AllowOverride None".

    However, the performance impact might not be noticeable if your site isn't under heavy load.
     
    CoderJosh, Aug 3, 2010 IP
  4. AKnogood

    AKnogood Active Member

    Messages:
    244
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Thanks guys. It looks like I'll have to do some optimisation...
     
    AKnogood, Aug 4, 2010 IP