Asp.net MVC框架:为什么浏览器寻找的favicon.ico [英] Asp.net Mvc: why is browser looking for favicon.ico
问题描述
我知道有一个解决方案,以阻止MVC框架来处理的favicon.ico的要求(<一个href=\"http://stackoverflow.com/questions/4624190/mvc-does-the-favicon-ico-also-look-for-a-controller\">solution),但我不知道为什么它寻找在首位此图标。
I know there is a solution to stop the mvc framework to process "favicon.ico" requests (solution), but i don't know why is it looking for this icon in the first place.
我搜查文件>整个解决方案使用查找的favicon.ico
并没有被发现。
I searched using Find in Files > Entire Solution for favicon.ico
and nothing was found.
我在搜索网页的HTML源文件code为的favicon.ico
并没有被发现。
I searched in the html source code of the website for favicon.ico
and nothing was found.
在哪儿呢?为什么浏览器尝试为它服务?
Where is it? why the browser is trying to serve it?
推荐答案
的favicon.ico是的约定的 - 但是是的有一个的方式,浏览器可以得到图像链接,标签等:
favicon.ico is a convention - but is one way that the browser can get the image for links, tabs, etc:
请注意,这些天,图像位置,也可以在元数据(这是很方便的设置,因为它可以使图像以单页,而不是每个域,和/或允许从不同的位置为它服务,如作为一个CDN):
Note that these days, the image location can also be set in metadata (which is handy as it allows the image to be per-page rather than per-domain, and/or allows for serving it from a different location, such as a CDN):
<link rel="shortcut icon" href="//cdn.sstatic.net/stackoverflow/img/favicon.ico">
<link rel="apple-touch-icon image_src" href="//cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
不过,/favicon.ico是回退,并且被许多旧的浏览器 - 或者没有指定明确的快捷方式图标
However, "/favicon.ico" is the fallback, and is used by many old browsers - or where no explicit shortcut icon is specified.
基本上:去创建一个
这篇关于Asp.net MVC框架:为什么浏览器寻找的favicon.ico的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!