{"action":"created","issue":{"url":"https://api.github.com/repos/hapijs/catbox/issues/148","labels_url":"https://api.github.com/repos/hapijs/catbox/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/catbox/issues/148/comments","events_url":"https://api.github.com/repos/hapijs/catbox/issues/148/events","html_url":"https://github.com/hapijs/catbox/issues/148","id":115205943,"number":148,"title":"Information on approach to cached objects","user":{"login":"jsmartfo","id":8195258,"avatar_url":"https://avatars.githubusercontent.com/u/8195258?v=3","gravatar_id":"","url":"https://api.github.com/users/jsmartfo","html_url":"https://github.com/jsmartfo","followers_url":"https://api.github.com/users/jsmartfo/followers","following_url":"https://api.github.com/users/jsmartfo/following{/other_user}","gists_url":"https://api.github.com/users/jsmartfo/gists{/gist_id}","starred_url":"https://api.github.com/users/jsmartfo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsmartfo/subscriptions","organizations_url":"https://api.github.com/users/jsmartfo/orgs","repos_url":"https://api.github.com/users/jsmartfo/repos","events_url":"https://api.github.com/users/jsmartfo/events{/privacy}","received_events_url":"https://api.github.com/users/jsmartfo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-05T04:16:21Z","updated_at":"2015-11-05T06:23:58Z","closed_at":"2015-11-05T06:23:58Z","body":"I am looking for some confirmation on how to store, update and expire data held in catbox. \r\n\r\nWe attempt a `get` on the cache, if the data doesn't exist we make a service call receive data and add to cache using `set` with a `ttl`, all new requests are served from cache until `ttl` expires, once it expires the data is automatically removed from cache and we make service call again to update. \r\n\r\nWith this approach the following issue can occur, service call fails or responds with bad data, the cache has expired and there is no longer an element in cache so now we are left in a situation without any data to serve. \r\n\r\nHow can I expire data in the cache (make it stale) but still have it served as a fallback if I fail to complete the service call to refresh - is this possible?\r\n\r\nThanks\r\n"},"comment":{"url":"https://api.github.com/repos/hapijs/catbox/issues/comments/153967803","html_url":"https://github.com/hapijs/catbox/issues/148#issuecomment-153967803","issue_url":"https://api.github.com/repos/hapijs/catbox/issues/148","id":153967803,"user":{"login":"hueniverse","id":56631,"avatar_url":"https://avatars.githubusercontent.com/u/56631?v=3","gravatar_id":"","url":"https://api.github.com/users/hueniverse","html_url":"https://github.com/hueniverse","followers_url":"https://api.github.com/users/hueniverse/followers","following_url":"https://api.github.com/users/hueniverse/following{/other_user}","gists_url":"https://api.github.com/users/hueniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/hueniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hueniverse/subscriptions","organizations_url":"https://api.github.com/users/hueniverse/orgs","repos_url":"https://api.github.com/users/hueniverse/repos","events_url":"https://api.github.com/users/hueniverse/events{/privacy}","received_events_url":"https://api.github.com/users/hueniverse/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T06:23:58Z","updated_at":"2015-11-05T06:23:58Z","body":"Just use stale with generate function."}}