Optimized directory cache.