如何清除IE的favicon缓存? [英] How to clear IE's favicon cache?

查看:125
本文介绍了如何清除IE的favicon缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的网站定义了一个最喜欢的图标:

i have a favorite icon defined for my web-site:

<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">

在添加图标后,任何浏览过网站的浏览器都可以显示最好的图标。但我自己的浏览器拒绝显示图标。

Any browser that has visted the site after i added the icon can display the favicon fine. But my own browser refuses to show the icon.

我已经尝试了我能想到的链接的每个变体:

i've tried every variation of the link i can think of:

<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">

<link rel="shortcut icon" type="image/x-icon" href="http://example.com/favicon.ico">

<link rel="icon" type="image/x-icon" href="favicon.ico">

<link rel="icon" type="image/x-icon" href="http://example.com/favicon.ico">

<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/x-icon" href="favicon.ico">

<link rel="shortcut icon" type="image/x-icon" href="http://example.com/favicon.ico">
<link rel="icon" type="image/x-icon" href="http://example.com/favicon.ico">

<link rel="shortcut icon" type="image/x-icon" href="renamed.ico">

无所谓,Internet Explorer(9)甚至拒绝尝试从中获取服务器(来自小提琴手的监控)。

It doesn't matter, Internet Explorer (9) refuses to even try to do a fetch from the server (monitoring from fiddler).

我已多次尝试清理缓存:

i've tried clearing my cache, many times:

(gear) -> Internet Options -> General -> Delete -> Temporary Internet Files

Alex在这个答案中认为最喜欢的图标的缓存方式与常规网页内容不同,并且不遵循常规清算规则。

Alex in this answer believes that favorite icons are cached differently than regular web-content, and don't don't follow regular clearing rules.

所以问题变成:我如何清除Internet Explorer收藏夹图标缓存?

So the question becomes: How do i clear the Internet Explorer favorite icon cache?

  • MSDN: How to Add a Shortcut Icon to a Web Page
  • Why isn't my favicon appearing in IE7/8?
  • favicon not working in IE
  • How do I force a favicon refresh
  • Cannot get Favicon.ico to display
  • Another favicon not working in IE
  • Favicon not showing, my icon is no good
  • favicon.ico cannot show on Internet explorer 7
  • Why doesn't my favicon display for my web site?
  • Favicon not showing, my icon is no good

推荐答案

它在历史记录中存储或不存在图标。如果要重置,请清除历史记录。 这是一个全面的常见问题解答

It stores the presence or absence of a favicon in History. If you want to reset it, clear your History. Here is a comprehensive FAQ.

编辑:引用博客,称之为广泛答案:

Quoting the blog, calling it an extensive answer:


为什么我的网站
的favicon不出现在IE7中?

why doesn't the favicon for my site appear in IE7?

这是最近在
2007-03-01上发布的帖子
的重新发布。原版可以在这里找到
这里。此版本已更新为
与当前现实相符。

当我在微软时,我是
开发人员的任务修复了IE7的
Favicon故事。最初的
IE6行为是下载
favicon一次 - 当用户创建一个网站
一个收藏夹。我不想深入了解这个
疯狂如何运作的详细信息,但是理解为什么
看起来如此破碎的
信息的关键部分是:a在网站的网址之间映射
网站的Favicon的url
将在IE的历史数据库中存储
,而图标的
实际位将是
存储在临时Internet文件
文件夹中。因此,如果您清除了
历史记录或缓存,或者
项目已经过期,那么图标
将永远消失。

When I was at Microsoft, I was the developer tasked with fixing the Favicon story for IE7. The original IE6 behavior was to download the favicon once--when a user made a site a Favorite. I do not want to go too deep into the details of how this craziness works, but the key piece of information to understanding why it seemed so broken is this: a mapping between the url of the site the url for the site's Favicon would be stored in IE's History database and the actually bits of the icon would be stored in the temporary Internet files folder. Thus, if you cleared your history or your cache, or the item expired out of either one, the icon would be gone forever.

快进到IE7。自IE6发货以来已超过两亿美元(三年)。
我们想要实现标签式浏览,
我们希望标签显示
正确的Favicons。所以我更新了
Favicon代码,以便在第一次访问时始终下载
图标。代码还
会记住,如果没有Favicon(404)
或它在某种程度上无效
(ExtractIcon()失败)。

Fast-forward to IE7. It has been over two (three?) years since IE6 shipped. We want to implement tabbed browsing, and we want the tabs to display the correct Favicons. So I updated the Favicon code to always download the icon on a first visit. The code also remembers if there is no Favicon (404) or it was invalid in some way (ExtractIcon() failed).

这是一个Mini-Faq(最后有一个奖金
的问题),当我在微软时,我写了

Here is a Mini-Faq (with one bonus question at the end) that I wrote while I was at Microsoft:

问:如何在IE7中为
我的网站制作一个小图标?

A: 有两种方法。
第一个是将文件放在域名的根
中,名为 favicon.ico
秒是使用< link> 标记与
rel =快捷图标 value和href
值设置为您希望显示的图标的URL。

Q: How do I make a favicon appear for my site in IE7?
A: There are two ways. The first is to put a file in the root of your domain called favicon.ico. The second is to use a <link> tag with the rel="shortcut icon" value and the href value set to the URL for the Icon you wish to display.

问: IE下载
favicon的频率如何?

A:当用户首次访问该网站时,IE会下载图标

图标存储在客户端
计算机上的Temporary
Internet Files文件夹中。有关
favicon的其他元数据存储在用户的Url
历史数据库中。如果任一商店清空
,或者与
favicon相关的商品自然过期,那么
下次访问时该图标将再次下载
。如果多个页面
(或网站)共享相同的图标,则
仅下载一次。 IE需要花费
才能将图标下载为
,以减少服务器上的负载

Q: How often does IE download the favicon?
A: IE will download the icon when a user first visits the site. The icon is stored in the Temporary Internet Files folder on the client machine. Additional metadata about the favicon is stored in the user's Url History database. If either store is cleared, or items relating to the favicon have naturally expired, then the icon will be downloaded again on the next visit. If more than one page (or site) shares the same favicon, it is only downloaded once. IE takes great pains to download the icon as few times as possible to reduce load on the server.

问:我看到我访问的一些
网站的错误图标。我如何解决这个问题?

A:如果历史数据库已经以某种方式损坏了
,那么就可以发生
。最简单的解决方案只需
即可使用删除浏览历史记录(在
工具菜单上)清除缓存和
历史存储。

Q: I see the wrong favicon for some sites I visit. How do I fix this?
A: If the history database has become corrupted in some way, this can happen. The simplest solution is just to use Delete Browsing History (on the Tools menu) to clear the cache and the history store.

问:我在我的网站上添加了一个favicon.ico作为你描述的
,但它仍然没有
出现。

A:它实际上必须是.ico
(图标)文件。位图,png,GIF,
等将无法正常工作。 IE7会将你的favicon
下载到Temporary Internet
Files文件夹并调用 <$ c文件
上的$ c> ExtractIcon()
。如果失败,我们将显示
默认图标而不是
favicon。

Q: I put a favicon.ico on my site as you described, but it still doesn't appear.
A: It must actually be a .ico (an Icon) file. Bitmaps, pngs, gifs, etc, will not work. IE7 will download your favicon to the Temporary Internet Files folder and call ExtractIcon() on the file. If this fails, we will show the default icon instead of your favicon.

问:我验证了我的favicon真的是
是一个图标,但它仍然不会出现


A:因为IE加载你的图标
临时Internet文件
文件夹,它必须能够实际
存储它。如果您为图标文件设置
no-cache指令,
则IE将无法显示
您的图标,而是显示默认的
图标。您可以使用 Fiddler 兑换
验证。

Q: I verified that my favicon really is an icon, but it still doesn't appear.
A: Since IE loads your icon out of the Temporary Internet Files folder, it must be able to actually store it there. If you are setting the no-cache directive for the icon file, then IE will not be able to display your icon and will display the default icon instead. You can use Fiddler to verify.

问:如何为我网站上的每个页面创建不同的favicon


A:放入
不同的代码在每个页面上,将
指向不同的图标。

Q: How do I create a different favicon for every page on my site?
A: Put a different tag on each page, pointing to a different icon.

问:我将网站的图标更改为
不同图标,但旧的仍然在IE浏览器中显示
。如何强制IE进行
更新?

A:如果您只是将
favicon.ico文件放在
的根目录中域名,IE没有任何方式
知道它是否改变了。要强制
更新,您需要使用标记和
指向与之前使用的
不同的文件名。将当前文件名
与存储在Url History数据库中的已知文件名
进行比较。
当IE看到文件名已更改时,
将下载您的新图标。
或者,您可以要求您的用户
清除其历史记录并缓存
(工具 - > Internet选项 - >删除
浏览历史记录),这也将是
force IE下载新文件。

Q: I changed my site's favicon to a different icon, but the old one still shows in IE. How do I force IE to update?
A: If you just put the favicon.ico file in the root of your domain, IE doesn't have any way of knowing if it changed. To force an update, you need to use a tag and point to a different filename than you previously used. The current filename is compared against the known filename stored in the Url History database. When IE sees the filename has changed, it will download your new icon. Alternatively, you can ask your users to clear their history and cache (Tools->Internet Options->Delete Browsing History), which will also force IE to download the new file.

问:什么仍然坏了?

A:两个
的东西:

Q: What is still broken?
A: Two things:


  1. 如果您通过标签指定
    备用位置,
    href会员必须是完全合格的
    并且不尊重标签。

  2. 标签必须有快捷方式
    图标作为rel值,但这是
    违反W3C规范,表示rel标签中的
    空格表示
    值列表。 IE将快捷方式
    图标视为单个值。幸运的是,这个
    仍适用于其他浏览器,他们看到
    快捷方式并忽略它,只需支付
    注意icon字符串。

这应该涵盖我收到的大部分关于IE7中的优惠价

问题。如果您有更多问题,可以随意询问

That should cover most of the questions I've received about favicons in IE7. If you have more questions, feel free to ask.

这篇关于如何清除IE的favicon缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆