Isn't it silly that a tiny favicon requires yet another HTTP request? How can I put the favicon into a sprite?

Sam picture Sam · Mar 4, 2011 · Viewed 49.1k times · Source

Everybody knows how to set up a favicon.ico link in HTML:

<link rel="shortcut icon" href="http://hi.org/icon.ico" type="image/x-icon">

But I think it is just silly that for a tiny several-byte icon you need yet another HTTP request. So I wondered, how could I make that image part of a sprite (e.g. background-position=0px -200px;) in order to speed up and save that valuable HTTP request. How can I get this into an existing sprite image with my logo and other artworks?

Answer

James Anderson picture James Anderson · Mar 18, 2011

I think for the most part it does not result in another HTTP request as these are usually dumped in the browser's cache after the first access.

This is actually more efficient than any of the proposed "solutions".