: Can I instruct the browser not to look for a favicon? 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 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.
More posts by @Merenda212
1 Comments
Sorted by latest first Latest Oldest Best
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.