Initial, untested code for cache.