Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2007 14:52:31 +0000
From:      Alex Zbyslaw <xfb52@dial.pipex.com>
To:        "Heiko Wundram (Beenic)" <wundram@beenic.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: performance impact of large /etc/hosts files
Message-ID:  <475FF5AF.1060902@dial.pipex.com>
In-Reply-To: <200712121356.01623.wundram@beenic.net>
References:  <475E0190.7030909@pacific.net.sg>	<200712121310.01617.wundram@beenic.net>	<475FD663.4070008@pacific.net.sg> <200712121356.01623.wundram@beenic.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Heiko Wundram (Beenic) wrote:

>Basically, why I personally rather like the squid (i.e., proxy-based) approach 
>to ad-blocking is the fact that if you try to do this at a lower level than 
>the HTTP-level, there's bound to be pages that display wrong/broken, simply 
>because not being able to fetch images (because they supposedly come 
>from "localhost") means that most browsers are not going to display the space 
>reserved to it and will mess up the page layout, even when specifying width= 
>_and_ height= in an img-tag (when only specifying one of the attributes or 
>none, the page layout will be broken anyway). Opera is my favourite candidate 
>for messing up page layouts in this case.
>
>On another note, Opera has an (IMHO) huge timeout for failed (i.e., refused, 
>not timed out) connections to the target host, and if many images refer to 
>localhost through some DNS or hosts magic, this is going to majorly slow down 
>page display/buildup on non-css based layouts, which sadly there still are 
>enough out there (and for some of which the ad-slots are an integral part of 
>the page layout, such as some german news sites).
>  
>
I'm certainly convinced that this is a viable solution to the ad 
problem, but it still seems *to me* far more work than dumping a bunch 
of hostnames in /etc/hosts.  I have, myself, had little or no trouble 
with page layouts messing up, but I maybe haven't used the solution on a 
large enough scale to notice.  But if you really want to configure the 
heck out of ads then squid would seem to have much more flexibility, at 
the cost of greater maintenance.

As for the timeouts issue, you are assuming that the host names are 
redirected to an IP address where nothing is listening.  I redirect to a 
local IP alias and do have an apache server listening which serves up a 
default page with a blue background.  I want to *see* the ad being 
blocked as it gives me a sense of smug satisfaction :-)  I'm sure you 
could do something more sophisticated, but this has worked well enough 
for me with virtually no maintenance.  I certainly get no noticeable 
delays with opera when I use it.

Best,

--Alex

PS The /etc/hosts solution must be described plenty of places that are 
google-able since I found it through none of the resources mentioned in 
this discussion.  I wish I could say I'd thought of it for myself, but 
like so many good ideas I just borrowed it shamelessly from somewhere else.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?475FF5AF.1060902>