Split out caching and test it.
Merge branch 'caching'