4

I suppose the answer to this question is a big NO, but, just to be sure, I ask here:

Are icons like <link rel="apple-touch-icon* always loaded by browsers (I mean, also not iOS browsers)?

MarcoS
  • 17,323
  • 24
  • 96
  • 174

2 Answers2

5

No. Browsers only load Apple Touch icons on first load.

Protocol to test this: I created two pages with the help of RealFaviconGenerator (full disclosure: I'm the author of this site), almost identical, and served them through Apache. page1.html contains:

<html>
    <head>
        <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
        <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
        <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
        <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
        <link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
        <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
        <link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
        <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
        <link rel="icon" type="image/png" href="/favicon-196x196.png" sizes="196x196">
        <link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">
        <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
        <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
        <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
        <meta name="msapplication-TileColor" content="#2b5797">
        <meta name="msapplication-TileImage" content="/mstile-144x144.png">
    </head>
    <body>
        <h1>Page 1</h1>
    </body>
</html>

And page2.html is the same one with a different h1.

Then, I visited page1.html, then page2.html and checked Apache's log to check HTTP accesses. Here is what I found.

Windows Chrome 36.0.1985.125 m

Navigate to Page 1

"GET /page1.html HTTP/1.1" 200 662 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
"GET /favicon-32x32.png HTTP/1.1" 304 179 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
"GET /favicon-16x16.png HTTP/1.1" 304 179 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"

Navigate to Page 2

"GET /page2.html HTTP/1.1" 200 662 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"

So Chrome loads some favicons on first load but do not load the icons again when it visits another page that references the same pictures.

Android Chrome 36.0.1.1985.128

Navigate to Page 1

"GET /page1.html HTTP/1.1" 200 662 "-" "Mozilla/5.0 (Linux; Android 4.4.2; SM-G900F Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.128 Mobile Safari/537.36"
"GET /favicon-160x160.png HTTP/1.1" 200 5703 "-" "Mozilla/5.0 (Linux; Android 4.4.2; SM-G900F Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.128 Mobile Safari/537.36"
"GET /apple-touch-icon-144x144.png HTTP/1.1" 200 9889 "-" "Mozilla/5.0 (Linux; Android 4.4.2; SM-G900F Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.128 Mobile Safari/537.36"

Navigate to Page 2

"GET /page2.html HTTP/1.1" 200 662 "-" "Mozilla/5.0 (Linux; Android 4.4.2; SM-G900F Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.128 Mobile Safari/537.36"

Same behavior.

iOS7 Safari

Navigate to page 1

"GET /page1.html HTTP/1.1" 200 662 "-" "Mozilla/5.0 (iPad; CPU OS 7_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D167 Safari/9537.53"

In other words, Safari does not load any icon when browsing. This makes sense: it does not display any icon in its interface.

Click the "Share" button

(to display the "Add to home screen" option)

"GET /apple-touch-icon-152x152.png HTTP/1.1" 200 10313 "-" "MobileSafari/9537.53 CFNetwork/672.1.13 Darwin/14.0.0"

Definitely makes sense.

Navigate to page 2

"GET /page2.html HTTP/1.1" 200 662 "-" "Mozilla/5.0 (iPad; CPU OS 7_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D167 Safari/9537.53"

Click the "Share" button

Nothing happens. Again, this is normal, the icon was already loaded.

Android Firefox 31.0

Navigate to Page 1

"GET /page1.html HTTP/1.1" 200 662 "-" "Mozilla/5.0 (Android; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0"
"GET /favicon-196x196.png HTTP/1.1" 200 13393 "-" "Mozilla/5.0 (Android; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0"

Navigate to Page 2

"GET /page2.html HTTP/1.1" 200 662 "-" "Mozilla/5.0 (Android; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0"
philippe_b
  • 38,730
  • 7
  • 57
  • 59
  • Thanks. This solves my concerns... I was afraid that on first load browsers would load *all* defined icons... :-( You only forgot to test Mozilla... :-) – MarcoS Jul 25 '14 at 12:16
  • @MarcoS Oops! Android/FF results added a minute ago. No surprise :) – philippe_b Jul 28 '14 at 14:57
2

No. Browsers don't follow link types they don't recognise.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Good. But, if they do recognize them (I suppose Chrome browser does recognize them), do they load them all? – MarcoS Jul 24 '14 at 12:09
  • Why do you suppose Chrome recognises them? It has no reason to. – Quentin Jul 24 '14 at 12:10
  • Absolutely. Android Chrome does load the Apple touch icon when it finds it. http://realfavicongenerator.net/favicon_compatibility – philippe_b Jul 25 '14 at 10:03