如何强制网站图标刷新? [英] How do I force a favicon refresh?

查看:142
本文介绍了如何强制网站图标刷新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Grails应用程序,它使用自己的tomcat在本地运行,而我刚刚将图标图标更改为一个新图标.问题是我无法在任何浏览器中看到它.出现旧的收藏夹图标,或者我什么都没有得到,但是我的新收藏夹却没有.我不认为这本身就是Grails的问题,更多的是网站图标问题.

I have a Grails application running locally using its own tomcat and I have just changed the favicon for a new one. Problem is that I can not see it in any browser. The old favicon shows up or I get no favicon at all, but not my new one. I do not think this is a Grails issue per se, more an issue with favicons.

收藏夹图标应该发生什么?他们应该如何工作?我的浏览器中有很多书签,这些书签的图标错误,它们似乎从未刷新过.如何强制服务器/浏览器停止缓存它们?鉴于通常只有16x16,总是缓存它们似乎很愚蠢.为什么不随页面访问一起上传它们呢?这并不是很大的开销.

What is supposed to happen with favicons? How are they supposed to work? I have numerous bookmarks in my browser which have the wrong icons and they never seem to get refreshed. How do I force the server/browser to stop caching them? It seems pretty silly to always cache them given they are normally only 16x16. Why not just upload them with every visit to the page? It is not exactly a huge overhead.

推荐答案

要刷新网站的网站图标,您可以强制浏览器使用链接标记和文件名上的查询字符串下载新版本.这在生产环境中特别有用,可确保您的用户获得更新.

To refresh your site's favicon you can force browsers to download a new version using the link tag and a querystring on your filename. This is especially helpful in production environments to make sure your users get the update.

<link rel="icon" href="http://www.yoursite.com/favicon.ico?v=2" />

这篇关于如何强制网站图标刷新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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