Change Cache Function core to make it support two type of cache type.