Copy some caching code from lobby facts.