Search code examples
favicon

how does this favicon.ico helps server bandwidth?


i was reading programmers.stackexchange.com/questions/46716...... Question Answer in that there's a point sayin

If you don’t have a /favicon.ico, this will result in a lot of 404s, draining your server’s bandwidth.

i just dont know how this icon helps in saving server's bandwidth ? i know 404 is a Not Found Error message but what this /favicon.ico plays role here ?

please somebody explain me this...


Solution

  • I see a couple of possibilities. The first is that your favicon.ico file may be smaller than the 404 page, but that's probably not much of a difference.

    However, if you have a massively complex custom 404 page that dynamically goes out to your database to get some information, there will be a hell of a difference in load compared to a static resource like the favicon.

    The second is the possibility that a real favicon may be cached somewhere along the way, either in the browser displaying your page, or somewhere else not on your site.

    This means that subsequent requests for it won't touch your server at all.

    It's unlikely that a 404 received by the browser will be cached in the same way, so the browsers would be far more likely to try again next time, leading to more load on your servers.


    In your comment, you question what the favicon is for so I'll cover that just in case: it's requested by browsers so that they can use it to (for example) provide an icon in the address bar, or on a bookmark, for your link.

    That way, Google (for example) could have a favicon consisting of the stylised 'G', Wikipedia has their 'W', and so on. Even StackOverflow has their nifty little overflowing in-tray sitting to the left of my address bar right now.

    See the Wikipedia favicon entry for more information than I want to cut-and-paste into this tiny text entry box :-)