How to force a client-side refresh on a new favicon

Posted . Visible to the public.

Browsers usually cache favicons. If you update the favicon of your web site and want all visitors to see the new icon, you need to give the icon a different URL. You will not have this issue if you cache your assets properly, which appends a fingerprint to your image URL (like favicon.ico?432423432):

<link href="<%= image_path('favicon.ico') %>" rel="icon" type="image/vnd.microsoft.icon">
Dominik Schöler
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2014-03-07 14:11)