Scott Hanselman

FavIcon.ico can be a bandwidth hog

January 3, '07 Comments [9] Posted in ASP.NET | Musings
Sponsored By

I got an email from ORCSWEB, my most excellent hosting company (check them out) that I'd used over 230 GIGs of bandwidth for the month. Oy. First, I was happy that the site is doing well, then I was disturbed. Something MUST be wrong.

So, I asked them to hook me up with a better stats package than the default and they hooked up SmarterStats immediately. I checked it out:

Notice anything odd there? Yes, my favicon.ico used 27 GIGS of bandwidth in the month. Yikes.

Turns out my icon was 70k, as I made it a wonderful high-quality "Vista" icon in an attempt to make things pleasant and everything for folks. Of course, I didn't noticed when it was taking up over 11% of my monthly bandwidth.

Long story short, I changed my icon from a multi-resolution (6 resolutions, all 16M colors) to a simpler one using Junior Icon Editor that has 3 resolutions at 16 colors and still looks nice. The icon is now under 4k, a 95% reduction that should lower this month's bandwidth by 25 GIGS.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Wednesday, January 03, 2007 10:00:43 AM UTC
This is a great tip. Mine is 8k, I think I'll try to pare it down to half that..
Wednesday, January 03, 2007 10:08:39 AM UTC
Sweet. I removed the 48x48 image and reduced the other two (16x16 and 32x32) to 16 colors.. mine is greyscale anyway. Now it's only a little over 2kb.

THE BANDWIDTH, SHE IS SAVED!
Wednesday, January 03, 2007 3:29:29 PM UTC
OK, the question begs, and forgive the ignorance: How and why did the icon use this much?
Wednesday, January 03, 2007 3:52:20 PM UTC
Could this be do to IE7? It used to be that you only would get the favicon to show in the address bar after saved the site in your favorites. IE7 picks it up everythime regardless of being in the users favorites list. Of course, it could be from me reading about your Africa trip everyday this last month. :) Nice to see you back and healthy Scott.
Daniel H
Wednesday, January 03, 2007 9:49:19 PM UTC
It's definitely strange that the favicon usage is so high. This is unlikely to be the fault of either IE6 or IE7, at least. IE6 in its default configuration makes no attempt to download the favicon. IE7 in its default configuration downloads the favicon once per new domain visited, and then caches it, so subsequent requests to pages on the site, both in the same IE process and in new IE processes, doesn't actually send a request over the wire.

Can you check out the useragent and referrer on those treacherous favicon requests and figure out whether someone's got a rogue RSS reader or scraper or something that doesn't know how to properly handle favicons?

It's weird, too, that there are 4x as many requests for the favicon as for other images that are probably shown on most or all of the pages of the site.
Junkface
Thursday, January 04, 2007 5:21:06 PM UTC
It doesn't surprise me. Firefox has retrieved favicon.ico for a long time. IE6 retrieved favicon when adding to favorites. Now IE7 retrieves it on every page load, just like any other resource on the page (I assume like other images, it's cached, too). Not to mention bloglines and dozens of other sites that never touch the main page, but retrieve the RSS feed and the icon to display next to it.
Saturday, January 06, 2007 9:47:02 PM UTC
Muy Interesante,

Having the same name (favicon.ico) from wherever it is loaded, a browser would need to check size and date/time stamp to verify whether or not the item is in cache. Hmm, that's enough data to rival the size of a normal icon. What's a good browser to do? May as well just get on with it and download favicon.ico whenever it shows up.

My IE7 in Vista got confused and loaded the butterfly favicon for msn in place of another site's dog paw favicon. Now msn has a bobblehead (bubblehead?) next to a monitor screen, and the dog paw is back for the other place.

--
jondr
jondr
Friday, January 19, 2007 3:51:37 PM UTC
A HTTP expiration header would reduce the number of requests to fetch the icon.
The icon would be fetched only once and stored in the cache of the browser, and hence there will be substantial bandwidth saving.

Hitesh
Hitesh
Sunday, January 21, 2007 2:18:59 PM UTC
Didn't anyone read the article? The reason that his bandwidth was so high was--

"Turns out my icon was 70k"

70 freakin k!! There is really no reason for a favicon to ever be over 3 or 4 Kb, so yeah, if you put up a few images on your site that is that huge, it slows the load time for dial-up users to a crawl and uses tons of bandwidth.

Raul
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.