1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Size of .htaccess File?

Discussion in 'Apache' started by Owlcroft, Apr 15, 2004.

  1. #1
    My suspicion is that the size of the .htaccess file is not, within what I would guess are rather broad limits, a critical factor, but I prefer knowledge to suspicions.

    I just renamed almost every file in my site, so my .htaccess file, with mod_rewrite rules and suchlike, is now over 100 lines and 8k. Is that as speed-trivial--milliseconds?--as I hope?

    It would be nice to be sure.
     
    Owlcroft, Apr 15, 2004 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Is there some sort of pattern the renaming follows? If so, you could probably condense it down within some reg expressions...

    - Shawn
     
    digitalpoint, Apr 16, 2004 IP
  3. expat

    expat Stranger from a far land

    Messages:
    873
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Owlcroft

    .htaccess is a bolt on to allow directory driven overrides
    thus if it is allowed (which it obviously is) apache runs an overhead of IO's anyway as it will hunt for the file in each and every directory each time.
    Processing the directives in it actually is negligble if kept to a reasonable amont.

    The big difference is that if you ever need to squeeze performance it helps to disallow and push this in the httpd.conf of apache but this requires a restart of apache as the directives are read in once (at start up) whereas .htaccess is read or hunted every time something is requested.

    So in answer to your question:
    as its on and already reducing performance (doesn't matter if it actually exists or not), basic usage will not degrade existing performance noticably.
    Remember it is per directory - the flatter the better.

    If you want to know the gruesome details
    http://httpd.apache.org/docs-2.0/howto/htaccess.html

    OK?
    M
     
    expat, Apr 16, 2004 IP
  4. Owlcroft

    Owlcroft Peon

    Messages:
    645
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Regrettably, there is not.

    I finally decided to bite the bullet and rename all my files from private shorthand names to meaningul names (like "welcome.shtml" to "site-overview.shtml"), hoping for some possible microscopic tweak in relevance.

    There are very few "pattern" changes--mostly particular renamings.

    Once the dust of the inevitable oversights and screwups settles, I'll rename my image and wallpaper files.

    The added increment in relevance is probably nearly zero, but sometimes putting one more gram on the scale pan next to all the pound weights is what it takes to tip it when PR numbers are being calculated. Anyway, it hurts nothing to try . . . .

    So, bottom line, if I have it aright: putting a hundred or so RewriteRule lines in the file slows down page access by maybe a few milliseconds or some such--is that about it?
     
    Owlcroft, Apr 16, 2004 IP
  5. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #5
    Yeah... you will be fine unless it's a very high traffic site... at which point you will want to put it in the httpd.conf file.

    - Shawn
     
    digitalpoint, Apr 16, 2004 IP
  6. Owlcroft

    Owlcroft Peon

    Messages:
    645
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I don't know exactly what "high-traffic" is, but I sorely doubt that under 10,000 hits a day qualifies (and that's actually several sites combined).

    Anyway, thank you all for the assistance.
     
    Owlcroft, Apr 16, 2004 IP
  7. expat

    expat Stranger from a far land

    Messages:
    873
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #7
    to minimise, be aware that the rules are worked on in sequence -

    the first match and processing ends (it'a also a nice pitfall I lost a lot of hair once ...).
    Thus puting the more likely rules top and the less likely bottom helps reduce server load.
    Cheers
    M
     
    expat, Apr 17, 2004 IP