19 May 2005

Bandwidth protocol

It's considered rude to use an image on your website that it hosted by someone else's server. If the person publishing that image pays charges for the bandwidth they use, or has a limit on how much bandwidth they may use each day, your usage of the image costs them this bandwidth every time someone looks at your page.

One solution to this problem is to host the image yourself. That's what I do when I want to use an image on this blog. I have an account on flickr, which is a terrific, and free, image sharing site, so I download the image I want to my computer, upload it to flickr, then get the necessary address from flickr for the image. That way, any bandwidth pulled for the image is my responsibility.

Via Ben93, I now learn a nifty trick for solving the problem. It seems that the nice folks at PlanetLab are offering a clever public image cache service.

Let's say you want to use an image at

http://www.foo.com/bar/image.jpg
Instead, use a modified URL with an address that actually points to PlanetLab by inserting a change in the address
http://www.foo.com.nyud.net:8090/bar/image.jpg
Violá! Folks will now pull the image from the generous folks at PlanetLab, rather than from foo.com.

Ben93 has a tip for using this:

It helps to preview the posting before you hit post as this gets the caching service to do the initial fetch of the picture, which can be slow, before your posting appears to the public. Sometimes you need to wait a few minutes and re-preview it before everything will appear as it should, and some web servers will not play ball with the cache, and this is how you weed those out.
Of course, before long Google is going to host everything on their Big Server Farm in the Sky, so this problem will go away ...

1 comment:

TheWayOfTheGun said...

Perhaps I'm being overly libertarian, but I've never agreed with the position that linking to somebody else's image is bandwidth theft.

That view is awfully difficult to differentiate from those companies which get upset by others providing deep links to their sites rather than only linking to the top level.

To take offense at either practice is to ignore the fundamental premises and design goals on which the web was built. The whole point is to make it easy for people to connect bits of information together. That is what HTML and HTTP were designed to do.

If I put an image (or anything else) up on a publicly accessible server, then the onus is on me to control the access in whatever way I need to. I can be clever and disallow access unless the referrer is one of my own pages, host the image somewhere else, or just yank it if the usage gets out of hand. I'd never in a million years complain to the linker that s/he shouldn't have been using the web exactly the way its creators intended.

Still, I've been concerned once or twice at the number of hits generated by an image I was hosting. It's nice to have an easy way to avoid that without getting fancy with my Apache configuration.