A transparent 16x16 favicon.ico file is always returned, regardless of site logos


(Franz) #1

Hi,

The favicon doesn’t show up in my browser (Chrome 46.0.2490.80 m) on this forum when I’m logged in:

It does show up if I log out, then disappears when I log in again.

Any idea?


(Régis Hanol) #2

I just tried on your site and I could see the favicon both times (logged out and logged in).


(Franz) #3

That’s weird.

I can actually reproduce the problem on Firefox as well:

Chrome:

Maybe I somehow disabled the favicon for my user? Is that even possible?


(Gerhard Schlager) #4

Maybe it works only on certain screen densities. At least that’s my conclusion after reading FAQ

The Favicon check for meta doesn’t look good either.

BTW: My Chrome on Android doesn’t show the favicon on the start screen. It’s just a yellow “D”. The favicon for Github works.


(Franz) #5

Can’t repro on IE:

But the problem persists in Chrome and Firefox even when the browser cache is disabled.


(Franz) #6

@gerhard Unrelated. I’m doing all my tests on the same PC, and the favicon shows properly in IE (always) and in Chrome/Firefox when not logged in.


(Gerhard Schlager) #7

Oh, sorry, I overlooked the part with (not) logged in. :blush:
Could it be that clearing the cache doesn’t remove cached Favicons? That still doesn’t explain why you see a different behaviour when you are logged in… Anyway, try with a new browser profile.
If it still doesn’t work, try using a network sniffer or at least the browser’s debugging tools to figure out what’s going on.

BTW: I noticed that the server’s certificate chain is incomplete. You should probably fix that.


(Franz) #8

@gerhard No problem.

I opened a Guest window in Chrome (so, technically, a different user profile I suppose) and the problem persists when I log in with my usual Discourse user. In the same browser window, I created a new user in Discourse, then logged in: the favicon showed up. Then I logged off again (the favicon was still there), and I logged in with my usual user, and again the favicon disappeared. Very strange.

Regarding the certificate chain being incomplete: I’m not exactly sure what I need to do, I guess I forgot to upload a certificate file on the server, thus it gets downloaded every time?


(Gerhard Schlager) #9

You need to concat your certificate and the intermediate certificate(s) otherwise your site works only in browsers that have the missing intermediate certificate in it’s cache.

cat "Your Certificate" "Intermediate CA Certificate" "Intermediate CA Certificate" >> ssl.crt

(Franz) #10

@gerhard Thanks, I’ll try to fix that.

Regarding the favicon problem, I’m not sure why Chrome doesn’t download it, even in incognito mode with caching disabled (even though the favicon shows up since I’m not logged in):


(Jeff Atwood) #11

Seems like https://meta.discourse.org/favicon.ico is returning something, but should not be.


(Franz) #12

@codinghorror Right, and that may occasionally confuse browsers? Should it special-case and return a 404 error?


(Franz) #13

Something new: This morning I’m seeing this (notice the pinkish square as favicon):


(Jeff Atwood) #14

Sorry, it seems this is mostly a support issue for the specific site in question. Other than the Android issue @gerhard pointed out, there’s nothing to fix in Discourse proper. The favicon.ico is mostly for ancient browsers and we’re about to drop support for IE9 on Jan 1 2016.

If necessary, we can redirect the requests for that file to the .png assets we must carry for modern browser icons, etc.


(Franz) #15

Jeff, related or not, I think you’ve hinted at something. In my case, https://forum.appleseedhq.net/favicon.ico does return a fully transparent 16x16 icon. Could this be the problem?


(Jeff Atwood) #16

Actually you’re right, I did not understand that we are returning a valid blank ico file here, which is … not good. @sam will change it so that nginx returns the 404 for that file, before it even hits the rails stack.

Long story but there are still a lot of requests for that file from old browsers and old crawlers and view-source and so forth.


(Sam Saffron) #17

Changed per:

The blank favicon was a hack I placed in the code base even before we had our Docker deployment story (we were noticing a lot of load on our custom 404 page which is not free to generate), now that we deploy using docker and NGINX is part of the stack we can send out cheap 404s using NGINX.


(Franz) #18

I just updated my instance, /favicon.ico does return a 404 error now, but the problem persist, only when I log in with my user. For all other users, the favicon shows up correctly.

I actually noticed that, when I’m logged in with my usual user, the favicon does show up briefly before disappearing. It gets replaced, or removed, after the page has completed loading.

Maybe that has to do with the fact that my user is an administrator, and thus more things get rendered or happen than for normal users?


(Franz) #19

Also, the favicon shows up correctly if I disable JavaScript.


(Gerhard Schlager) #20

Wild guess: Maybe it’s the counter shown on the browser icon that’s causing this.
Try disabling “Show new / updated topic count on browser icon” in the user’s preferences if it’s enabled. Does that help?