a ttl memo function with pre-emptive cache refresh