Re-implement caching.