Add timeout/cache system to help when listing the directory takes too long.