Split out caching and test it.