Caching in a new thread