[fix] proper default cache type
[major] implement caching (part 1) and tests