6

I would like to know why favicons, unlike images and other resources are stored far longer in cache and seem to be very persistent as well. I'm using Google Chrome, so the question aims this browser, but also browsers in general as I observed this behavior in other browsers, too.

This question (related, not a duplicate) targets the "how to delete them" question. However, I want to understand why favicons seem to be treated so distinctively, whereas my interest in deleting them is rather secondary to irrelevant.

As a web developer, I can simply apply favicon.ico?2 and get a "fresh" one. And the responsibility lies in the provider of an application rather than in the user managing his own cache (or "petting" my application as I like to call it). So this is not my main question.


Why do favicons seem to be more persistent than other resources?

Community
  • 1
  • 1
bytecode77
  • 14,163
  • 30
  • 110
  • 141

2 Answers2

3

I don't think there is any official specification about how long favicons should be cached (and why). You should rather ask browsers developers why they decided to cache them longer.

My guess is that since websites change favicons relatively rarely, there's no need to check very frequently if a favicon has been updated.

Michał Perłakowski
  • 88,409
  • 26
  • 156
  • 177
  • 1
    Also, favicons are used for plenty of things, like OS shortcuts (`.url` files), history listing, "dashboard" (Speed Dial on Opera 9-12, Front Page on Firefox, ...), tabs and a few more. – Ismael Miguel Jun 26 '16 at 14:51
  • Also for tracking users :) – MiKr13 Mar 16 '21 at 16:35
0

I assume browser manufacturers have found it reasonable to cache favicons for a long time because of a few reasons:

  • It's a bit of a gamble but it's a pretty safe one. Statistically - favicons rarely change. I bet Google has stats on how often the average favicon is changed, and I'd bet it's not more than once per year.

  • Since tabs are a prominent browser feature, it's great if you can instantly see a favicon in the tab while visiting a site. However, it's great if you can fetch the favicon from cache, cause if you have to make a network request to fetch it - that request would probably be prioritized pretty low on the list, compared to loading critical resources for the web page itself. If you couldn't cache the favicon for a few days the browser would have to load it via a network request pretty much every time - which might make the browser tab feel sluggish to the user.

  • Since browsers use favicons for long lasting data like bookmarks - it can be benefitial to cache them for a long time. When a user is browsing through their bookmarks it looks nice if they all have a favicon, even if you haven't visited that page for ages.

Drkawashima
  • 8,837
  • 5
  • 41
  • 52