View Single Post
Old 2005-01-14, 07:54 PM   #10
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
Code:
ErrorDocument 404 http://erotic-exotic-porn.com/
ErrorDocument 403 http://erotic-exotic-porn.com/

#don't really need this if you are doing 'positive' checking below
# however, if you did do this, it would short circuit things, making the deny happen much more quickly, at which point you should do [F,L]
#RewriteEngine on
#RewriteCond %{HTTP_REFERER} lewww [OR]
#RewriteCond %{HTTP_REFERER} fusker
#RewriteRule .* - [F,L]

DirectoryIndex index.shtml index.php index.html index.htm

# the regexp engine performs better with only a left anchor rather than a left & right anchor with a floating match

RewriteEngine on
RewriteOptions inherit
RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http://www.cleoshornylinks.com [NC]
RewriteCond %{HTTP_REFERER} !^http://cleoshornylinks.com [NC]
RewriteCond %{HTTP_REFERER} !^http://cleoshornylinks.com [NC]
RewriteCond %{HTTP_REFERER} !^http://www.cleoshornylinks.com [NC]
# since there is a left anchor above, you can really remove these since the are already matched above
#RewriteCond %{HTTP_REFERER} !^http://cleoshornylinks.com:80/.*$ [NC]
#RewriteCond %{HTTP_REFERER} !^http://www.cleoshornylinks.com:80/.*$ [NC]
#RewriteCond %{HTTP_REFERER} !^http://cleoshornylinks.com:80.*$ [NC]
#RewriteCond %{HTTP_REFERER} !^http://www.cleoshornylinks.com:80.*$ [NC]

RewriteRule (gif|jpg|png|swf|mpg|avi|GIF|JPG|PNG|SWF|MPG|AVI)$ http://cleo-says-fuck-you.com/ [R,L]
That's what I would suggest -- it removes a few checks which streamlines the request processor. Saving a few cpu cycles per request doesn't sound like much, but, when the thundering herd comes in, sometimes even saving a few cpu cycles here and there can allow your machine to perform a little better.

I have a P3/800 doing 1.3 million pageviews a day at 12% cpu utilization. A client has a P2.4 doing 300k (doing the same effective task) and averages 40% cpu utilization.

Personally, I like the optimizations.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote