add support to cache devices along with its tree.