The best answers to the question “How do I force a favicon refresh?” in the category Dev.
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.
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 16×16. Why not just upload them with every visit to the page? It is not exactly a huge overhead.
Adapted from lineofbird’s answer beloew, you can do the following:
Go directly to the favicon url in the address bar by typing in it’s address e.g.
Navigate to the url by pressing Enter
Refresh with Ctrl+F5
Restart your browser (e.g. Chrome, Firefox)
To refresh your site’s favicon you can force browsers to download a new version using the link tag and a query string 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" />
Rename the favicon file and add an html header with the new name, such as:
<link rel="SHORTCUT ICON" href="http://www.yoursite.com/favicon2.ico" />
This answer has not been given yet so I thought I’d post it. I looked all around the web, and didn’t find a good answer for testing favicons in local development.
In current version of chrome (on OSX) if you do the following you will get an instant favicon refresh:
- Hover over tab
- Right Click
- Select reload
- Your favicon should now be refreshed
This is the easiest way I’ve found to refresh the favicon locally.