Naive caching wrapper.