15
I’ve always used only the favicon.ico
on the pages HTML
, with it at the root and with its link rel
in the HEAD
:
<link rel='shortcut icon' href='https://site/favicon.ico'>
But recently, observing the server log, I saw that errors due to lack of other versions of favicons are a constant, mainly those of apple, generating logs as the below:
... [core:info] ... File does not exist: /home/meusite/www/apple-touch-icon.png
I was in doubt if these requests that do not complete can affect the server performance, and today I found a favicons generator which in addition to generating for various versions and sizes (apple, android etc), also generates various paths with <link rel>
for each version, and some attributes meta
, and even a json
, as in the example below:
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
However it seemed a lot to include in all HTML pages, and looking at the sources of some reference sites, I saw that none uses all these link rels
and meta names
suggested by the generator.
So the question is whether it’s really good practice to include all these images in /
, and all these links rels
and meta names
in the HTML code of all pages of the site, both for usability and performance?
I think in such cases the developer should ask "Which browsers do I need to support?" , "If in 1 of my 1000 users the icon appears with a bad resolution, is it a problem?". You have to balance the benefit cost into the balance
– Costamilam
@Costamilam The idea is to support all browsers, and if for 1 of my 1000 users the icon does not appear to me is death! : ) But seriously, I hate the idea of the icon not showing up, I think it totally breaks the design, it gets kind of dirty haha thing. The point is, if I have, say, 200 pages on the site, it will be worth it (because a little should affect the overall performance of the site right) include this lot of HTML in the pages.
– gustavox
It is more things to load, but I consider little thing, it is not only not appearing, as you can see, in HTML you add of several sizes (16x16, 32x32, etc), Tavez one or two of each
rel
different solve your problem, may not look perfect in all Vices, but need?– Costamilam
Boy if it were me in charge of the project and it was really necessary I would do a javascript programming to catch the screen size of the user and based on the result obtained would create the tag at runtime and add it in DOM and good would always have 1 tag only
– SneepS NinjA