Cache directory lists for faster performance.