First go at some caching work  - serious WIP