On 9 May 2009, at 18:12, Owen Winkler wrote:
Imagine you have a thing that you fetch from a remote site to display onyour Habari output. You can put it in the cache. When the cache item expires, you would fetch the item again to refresh it.The problem happens when the remote resource becomes temporarily unavailable after the cache expires. If the request is unable torefresh the cache, then the cache is empty rather than holding the lastcached value. I think we should build an additional parameter into Cache::set() that allows the cache value to persist after expiry, but report via a new method, Cache::expired(), that the cache has expired.
We ran into this at work the other day, keeping the original value in cache if the remote resource isn't available is the best way.
+1 for this from me. C --- Caius Durling [email protected] +44 (0) 7960 268 100 http://caius.name/
PGP.sig
Description: This is a digitally signed message part
