What is a cache and why do I need to refresh it?

David posted a comment to my last blog entry with a sarcastic “What is a cache and why do I need to refresh it?”. He's got a valid point.

To me, having “refreshing a cache” in the status UI is much like the rationale for having both suspend and hibernate in the UI. The user shouldn't need to know the difference between suspend and hibernate as they are both ways of making the computer “sleep”. The reason why we have to expose both into the UI is that suspend is fast, but has volatility, and hibernate is slow but doesn't. This is just a technical design decision that is made due to other unfixable design decisions or hardware limitations.

I think it's much the same for refreshing a cache. The user shouldn't have to know what it is doing, it should just work, but the unfortunate drawback is that refreshing a cache can take quite a long time and during that time none of the other functionality like searching or getting the update list works until this is completed.

So, the short answer is that the cache is automatically updated on the first logon (20 seconds after the network comes up for the first time) and then every 12 hours after that. It will be per-session configurable in gconf for sure (as you don't want to suck 500k of metadata down a 14k dial up link….), and you can also force a refresh in the update GUI tool.

I welcome other more less-technical names for “Refreshing package cache” maybe:

  • Updating package lists
  • Updating software metadata
  • Refreshing repository data

Other name suggestions welcome. Reply via blog or email. Thanks.

One response to “What is a cache and why do I need to refresh it?”

  1. Anonymous

    I don't think updating the package cache automatically after logon is great, expecially on old machines…this could take several minutes to get a ready for use desktop.

Bad Behavior has blocked 2769 access attempts in the last 7 days.