Published on

Fix: Safari showing old favicon issue due to Cache

Authors

Does your website or web app still show old favicon in just Safari?

The reason behind it could be because of Caching. Safari does aggressive caching of resources like favicon as a result your new favicon might not be displayed as expected (if you've already visited the site)

One way to confirm this issue is by clearing your Cache

Thankfully, you can solve this by cache-busting

Method 1: Add a cache-busting parameter

Append some query string in your favicon's URL like ?v=x.x. And it'll force Safari to fetch a new favicon.

BeforeAfter
https://example.com/favicon.icohttps://example.com/favicon.ico?v=1.2

Method 2: Change the filename

To be on the safer side, you can also change its filename instead of adding a cache-busting parameter. That will make sure to fetch the new URL without fail in Safari.

BeforeAfter
https://example.com/favicon.icohttps://example.com/favicon-new.ico

Happy resolving cache!