Cache values that have been previously visited.