Safari: Clearing ‘Icons’ cache to make favicon.ico work

Posted by Pierre Igot in: Macintosh
July 25th, 2005 • 5:26 pm

I have written about the favicon.ico thing before. Moving the Betalogue web site to a new server caused a re-occurrence of some of the problems that I had experienced initially. And I was able to better identify the cause this time.

The problem is that, when I started building my new web site at www.betalogue.com, I didn’t upload the favicon.ico file right away. So for a while, the new Betalogue web site didn’t have a favicon.ico, and Safari used the default generic globe icon that it uses for all web sites that don’t have their own icons.

But then I uploaded the file, and went back to the site in Safari. Safari would still show the generic globe icon. I launched Camino and, sure enough, in Camino my favicon.ico icon for Betalogue was there. So what was wrong with Safari? I tried forcing a complete reload of the site. (Is it command-Reload or shift-Reload or option-Reload? I don’t know. I tried all three.) I tried quitting and relaunching it. That didn’t work.

Then I figured it had to be a cache issue. So I went digging, and soon found the following. If you quit Safari, go to your home library folder, go to the “Safari” folder and then trash the “Icons” folder that’s inside there, if you relaunch Safari and load the site again, this time it will have the proper icon.

In other words, it looks like Safari has a cache for favicon.ico icons and assigns the default generic globe icon to sites that don’t have their own icons in a way that’s permanent until you actually trash the “Icons” folder. Worse still: Using Safari’s built-in “Reset Safari…” command (in the “Safari” menu) doesn’t work, but this command resets all kinds of things, but not the icons cache. The only solution that I am aware of is to manually trash the “Icons” folder. Not exactly user-friendly.

Another thing that I noticed is that I didn’t have to add any special code to the header of my home page in order to get the browsers to recognize the icon. Normally you have to use this:

<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> 

(Not sure why there are two lines here. I’d have to research this again.)

But I forgot to include these two lines on my new site. (The old Betalogue site was a subfolder of my main LATEXT site, and the code was in the header of the index page for the main site.) The icon was still recognized and displayed. I am not sure it’s properly displayed in all browsing software, but it works in Safari, Camino, Firefox, and NetNewsWire… 


Comments are closed.

Leave a Reply

Comments are closed.