Web pages these days are so full of advertisements, trackers, counters, hidden pixels, it’s a wonder they load at all. And who knows what information you’re revealing about your browsing habits.
Browser plugins like Adblock Plus and Ghostery can filter out a lot of the crud, but because these are scripts run in the browser itself, they can’t always stop the content actually being downloaded – they just hide or disable it once it’s arrived. So your web page will speed up but not by as much as is actually possible.
A better way to stop a lot of this unwanted material before it even reaches your computer is to get your operating system to block it for you.
This is done by editing (or replacing) a specific file on your computer, called “hosts“.
When your computer is asked to find a URL, whether it’s a web page, an image, a counter, or anything else, it first checks its hosts file to see if there is a particular entry telling it where to look, before it then hits the internet in order to find the object.
So it follows that if you don’t want to receive any advertisement images from (say) “adverts-r-us.com”, then if you add an entry to your hosts file saying that adverts-r-us.com is actually on your own computer, not on the web, when you computer loads a web page containing an ad on that domain, it will immediately fail to find the ad, so your browser will receive an error (which you’ll never see) and you won’t receive the ads. And this all happens in milliseconds because your computer isn’t even touching the web. Neat.
Of course, there are thousands if not millions of domains that serve up advertisements, counters, trackers, etc, and it would take a lifetime to find all of them and add them to your hosts file, by which time new ones would have sprung up. You’d never manage to block everything that is slowing down your browsing experience.
Guess what: someone has done it for you. At the someonewhocares.org website, an enterprising guy called Dan Pollock has posted a hosts file containing about 12,000 entries relating to domains that either serve you ads or track you in some way. So if you install it on your computer, your browser will be downloading much less unwanted material. This file is updated regularly, by the way.
I’d recommend revisiting Dan’s site every few months and repeating the process, so that you pick up new trackers and domains that have been added.
If you read the hosts file on Dan’s website, you’ll see that in the initial comments block (all the lines starting with ‘#’), he’s given instructions for other platforms including Linux and various versions of Windows.