Favicon requests are made to root path even if an explicit load direction exists
I'm using Firefox/39.0 to open an intranet site.
The site contains the below tag in header: <link rel="icon" type="image/x-icon" href="theme/images/favicon.ico">
I would expect that Firefox would always try to load the favicon from the given path theme/images/favicon.ico. However, sometimes it tries to load the favicon from the root path /favicon.ico
The first time that I open the browser and navigate to the intranet site, I can see the GET request to retrieve the favicon. If I close the browser, reopen it, navigate to the site and press Ctrl + F5 multiple times, then I see some requests to the root path /favicon.ico. Do you have any idea why this happens? I would appreciate any hint.
[21/Jul/2015:21:12:01 +0300] "GET /myapp/theme/images/favicon.ico HTTP/1.1" 200 4286 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0" [21/Jul/2015:21:15:08 +0300] "GET /favicon.ico HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0"
Все ответы (2)
It is possible that Firefox already tries to request the favicon before waiting for the arrival of the main HTML file.
You could check the requests via the Live Http Headers extension.
cor-el said
It is possible that Firefox already tries to request the favicon before waiting for the arrival of the main HTML file.
According W3C HTMl5 Links Recommendation: "In the absence of a link with the icon keyword, for Documents obtained over HTTP or HTTPS, user agents may instead attempt to fetch and use an icon with the absolute URL obtained by resolving the URL "/favicon.ico" against the document's address, as if the page had declared that icon using the icon keyword.".
So, I suppose that in case a link with icon keyword exists, Firefox should not perform a request to the root path.