I <3 Steve McConnell*
Coding Horror
programming and human factors
by Jeff Atwood

September 09, 2005

Speeding up web browsing

In order to speed up my web browsing experience, I disable Flash in Internet Explorer. I've got nothing personal against Flash, mind you, but it's generally chrome. It's visually (and sometimes audibly) distracting, and it adds download time to each page view.

Managing Add-Ons in Internet Explorer

An image is worth a thousand words, but for completeness, here's the step-by-step:

  1. Select the Tools, Manage Add-Ons menu
  2. The dialog defaults to add-ons currently loaded. Look for "Shockwave Flash object" and "Shockwave ActiveX Control" from publisher "Macromedia, Inc". If these aren't visible, choose "Add-ons that have been used by Internet Explorer" from the dropdown menu. Sort the list by Publisher and look for Macromedia.
  3. Click each add-on, then click the Disable option button.
  4. Click the OK button. Upon exiting the dialog, it will warn you that you need to restart IE, but this isn't the case. The current page will simply refresh and the flash movies will be either gone entirely or replaced with GIFs.

Flash is also the source of a giant memory leak in Firefox, so it's probably a good thing to disable there as well. I rarely need to see Flash movies as part of my normal web browsing, but if I do, I just reverse the above steps. I'm sure there's some fancy Firefox conditional display mod (eg, click to display the flash movie) out there, too. Some quick Google searching confirms that indeed there is. Go figure.

I'm also experimenting with using a custom HOSTS file that blocks ad domains. I'm not anti advertising so much as I am pro speed. And the fastest downloads of all are the ones you don't have to do!

So what's the HOSTS file?

In computing, a host file, stored on the computer's filesystem, is used to look up the Internet Protocol address of a device connected to a computer network. The host file describes a many-to-one mapping of device names to IP addresses. When accessing a device by name, the networking system will attempt to locate the name within the host file if it exists. Typically, this is used as a first means of locating the address of a system, before accessing the Internet domain name system. The reason for this is that the host file is stored on the computer itself and does not require any network access to be used, whereas DNS requires access to an external system, which is typically slower.

What we're doing is redirecting a bunch of ad-specific domain names to the loopback 127.0.0.1 IP. That way, when your browser tries to download an advertising image from, say, m.doubleclick.net, it returns in under a millisecond with a 404 "file not found" error. Compare that to the time it would take to perform an actual download of a 20-50kb flash or GIF advertising file from a remote website. It's a substantial speed boost!

I'm not aware of any negative effects of blocking ad domains this way, but I encourage you to visit the hosting page for details. For convenience's sake, here's a direct link to the zipped HOSTS file from the mvps site. Make a backup of your c:\windows\system32\drivers\etc\hosts file, then overwrite it with the ad-blocking version contained in that zip file.

Posted by Jeff Atwood    View blog reactions

 

« The Spolsky-Babbitt Connection Stupid Registry Tricks »

 

Comments

IMHO one should use Firefox instead of IE for many reasons. One of the best reasons is the Adblock plugin, which allows you to selectively disable content from any site. With Adblock you can block Flash (or anything else) from ad serving sites, without disabling all Flash. Adblock effectively disables all chrome - images, Flash, javascript, you name it - without disabling good stuff.

Ole Eichhorn on September 11, 2005 02:01 AM

One negative effect of not downloading ads is that the site's owner gets no revenue while you do get his/hers content. So if nobody would download ads, some sites might start to demand money before you're able to get the content.

Joost on September 11, 2005 07:14 AM

I use Avant Browser for my day to day surfing. It's a custom shell that adds features and functionalities to Internet Explorer, for instance optional Flash/Ads/ActiveX/Script-blocking. It has been around for long now, so it's very stable, very configurable, and since it's using the IE engine, all pages display as expected. Best of all, it's donation-ware (try it, and if you like it, donate an amount you can afford).

<a href="http://www.avantbrowser.com">http://www.avantbrowser.com</a>;

C-J Berg on September 11, 2005 08:54 AM

I've been very pleased with AdShield which blocks unwanted content, web bugs, images, etc. in IE.

http://www.ad-shield.com/

It is similar, to AdBlock for FireFox.

I'm affiliated with AdShield only in that I used to work with the author of the product and I am a happy user of it.

Mark Sicignano on September 11, 2005 09:14 AM

For the most part, I tend to use Firefox. However, for your above example you refer to a "Tools >> Manage Add-ons" menu...is this IE7?

zonker on September 12, 2005 10:24 AM

No, that's in IE6, it came with SP2.

Jeff Atwood on September 12, 2005 12:31 PM

I second the adBlock and fireFox recommendation.

I frequently block "<a href="http://*someDomain.com/*.swf">http://*someDomain.com/*.swf"</a> and it works beautifully.

smelliot on September 12, 2005 01:12 PM

SP@...XP, right? That probably explains it. I'm using IE6 but the About screen shows SP1 plus a bunch of individual updates. I'm also using a 2000 Pro box at work (where I am now) and I know that I'm current with Windows Updates. I'm guessing that if I were using IE6 on XP with SP2, then I'd see the menu. I'll have to check for it when I get home...just never noticed it before.

Thanks for the info!

zonker on September 12, 2005 04:38 PM

> One negative effect of not downloading ads is that the site's owner gets no revenue while you do get his/hers content.

Simply downloading the ad doesn't result in revenue, does it? You have to actually CLICK on it to generate revenue for the site.

Of course if nothing shows up, there's no way to click on anything so it's kind of a moot point.

My goal isn't really to get rid of ads. It's the images/flash that I don't want. I'd be fine with textual fallback ads like google adsense.

Jeff Atwood on September 19, 2005 06:08 PM

There is an explicit Flashblock extension for Firefox.

http://flashblock.mozdev.org/

It has a play button as well, in case you really do want to see the flash.

Scott Schecter on September 22, 2005 11:53 AM

Out of curiousity (I know this is a big 2 year bump)...but does anyone know what kind of performance implications are there with having a hosts file that big? Does the file get loaded and cached in memory when the os loads?

Jonas on November 1, 2007 12:51 PM

dunno about any slowdowns other than at the time you place/edit the hosts file. Occasionally I'll edit one of the large ones by hand and W2K SP4 will slow to a crawl. Haven't noticed that as much on XP SP2.

I used a group policy to blast out the large hosts file to about 50 PCs and I haven't had any complaints about it.

dhanson865 on December 17, 2007 12:35 PM

Good idea

James on January 16, 2008 12:37 PM

http://www.goldxcash.us

James on January 16, 2008 12:38 PM







(hear it spoken)


(no HTML)




Content (c) 2008 Jeff Atwood. Logo image used with permission of the author. (c) 1993 Steven C. McConnell. All Rights Reserved.