a very first version of caching in mem.