cache-tree: wrap the_index based wrappers with #ifdef