Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a website that doesn't have/need a favicon.

Is there a way to instruct the browser not to waste a request looking for /favicon.ico ?

I don't mean filtering logs, but something client-side, like this:

<link rel="shortcut icon" href="about:blank" />

That appears to work, but I'm not in a position to do comprehensive tests, (and search engines are being unhelpful).

Can anyone confirm if this is a valid method, or provide a suitable alternative?

Update: On further investigation, that doesn't work (at least not with Chromium 18 on a non-local domain). A partial solution is using a data: URL to serve a base64 blank image, (example from here):

<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" rel="icon" type="image/x-icon" />

This is working, but has two down-sides:

  • It will presumably fail in browsers that don't support data URLs.
  • It results in no favicon at all - i.e. it hides the browser default icon.
share|improve this question
    
Did you see this question on SO ? –  j0k Sep 14 '12 at 16:16
    
Nope, thanks for the link. Going on from Max's "use a blank file" comment, I'm wondering if <link href="data:image/x-icon;" rel="shortcut icon" /> is a valid solution - seems like it might be working (shows browser default), but need to test how IE7/others respond to it. –  Peter Boughton Sep 14 '12 at 16:24
    
Just tried on IE8 and it displays the default favicon –  j0k Sep 14 '12 at 16:29
    
Hmm, hidden in a non-obvious link in an answer to that question is a related question on SO with lots of answers/comments - doesn't appear to be anything new/useful, but in case I've missed stuff here's the link anyway. –  Peter Boughton Sep 14 '12 at 16:29
2  
[It might be worth noting here that sites which are generally extremely concerned about performance, page size, requests, etc., and with likely better reason, eg. Google, Yahoo, for the most part just go ahead and create an icon and move on to more important problems.] –  Su' Sep 14 '12 at 17:38

1 Answer 1

Well, I just went and did some testing with a bunch of random browsers I happened to have installed, Wireshark and a simple web page containing the tag

<link rel="shortcut icon" href="about:blank">

Here are the results so far:

  • Chromium 18.0 on Ubuntu Linux: Works. No requests for /favicon.ico, no favicon shown.

  • Google Chrome 21.0 on Windows XP: Works.

  • Firefox 15.0.1 on Ubuntu Linux: Inconsistent behavior. Apparently, Firefox shows no favicon and makes no HTTP request for /favicon.ico on the first page load. However, when the page is visited the second time, /favicon.ico is loaded and displayed.

  • Firefox 15.0 on Windows XP: Inconsistent behavior, same as above.

  • Opera 10.10 on Ubuntu Linux: Doesn't work. Requests /favicon.ico but does not show it.

  • Konqueror 4.8.4 on Ubuntu Linux: Works.

  • rekonq 0.9.1 on Ubuntu Linux: Broken. Tries to request /about:blank from the server.

  • Internet Explorer 8.0 on Windows XP: Inconsistent(?). Seemed to be working at first, but /favicon.ico was requested at some point, most likely after I visited another page and used the back button. Testing was somewhat complicated by the fact that, for some reason, IE is refusing to actually render my test favicons. Needs more testing.

Other notes:

Browsers tend to cache favicons pretty damn aggressively. Normal methods for clearing the browser cache don't always seem to work; I had to run the browsers with brand new sandboxed profiles to get consistently repeatable results. Notably, reconq at least will fall back to showing the (non-default) favicon from another page on the same site if it has one cached.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.