From owner-freebsd-questions@FreeBSD.ORG Wed Dec 12 14:52:34 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C49016A468 for ; Wed, 12 Dec 2007 14:52:34 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) Received: from mk-outboundfilter-1-a-1.mail.uk.tiscali.com (mk-outboundfilter-1-a-1.mail.uk.tiscali.com [212.74.114.5]) by mx1.freebsd.org (Postfix) with ESMTP id 15E2613C468 for ; Wed, 12 Dec 2007 14:52:33 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) X-Trace: 258035/mk-outboundfilter-1.mail.uk.tiscali.com/PIPEX/$MX-ACCEPTED/pipex-infrastructure/62.241.162.31 X-SBRS: None X-RemoteIP: 62.241.162.31 X-IP-MAIL-FROM: xfb52@dial.pipex.com X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAJyEX0c+8aIf/2dsb2JhbAA Received: from galaxy.systems.pipex.net ([62.241.162.31]) by smtp.pipex.tiscali.co.uk with ESMTP; 12 Dec 2007 14:52:32 +0000 Received: from [192.168.23.2] (62-31-10-181.cable.ubr05.edin.blueyonder.co.uk [62.31.10.181]) by galaxy.systems.pipex.net (Postfix) with ESMTP id 0943FE0000DB; Wed, 12 Dec 2007 14:52:31 +0000 (GMT) Message-ID: <475FF5AF.1060902@dial.pipex.com> Date: Wed, 12 Dec 2007 14:52:31 +0000 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.13) Gecko/20061205 X-Accept-Language: en MIME-Version: 1.0 To: "Heiko Wundram (Beenic)" References: <475E0190.7030909@pacific.net.sg> <200712121310.01617.wundram@beenic.net> <475FD663.4070008@pacific.net.sg> <200712121356.01623.wundram@beenic.net> In-Reply-To: <200712121356.01623.wundram@beenic.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: performance impact of large /etc/hosts files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2007 14:52:34 -0000 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.