How do I force a favicon refresh?
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.
www.yoursite.com/favicon.ico
www.yoursite.com/apple-touch-icon.png
- etc.
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" />
By destroying the file your browser uses to store old favicons, you can force new ones to be loaded.
- Close your browser. Make sure there are no longer browser processes running (e.g. check Task Manager for
chrome.exe
orfirefox.exe
). - Navigate to where your browser stores user files:
- For Chrome, go to the Chrome data directory.
- For Firefox, go to the Firefox profile folder.
- Delete the favicon cache.
- For Chrome, remove
Favicons
andFavicons-journal
- For Firefox, remove
favicons.sqlite
- For Chrome, remove
This will almost definitely work. If not:
- Possibility 1: An update to your browser has changed how the favicon cache works. Please edit this answer with new instructions.
- Possibility 2: Your favicon problem has nothing to do with overaggressive caching. It may instead be a resource-loading problem – using Developer Tools, make sure the new favicon is downloading properly.
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.