Added option to enable directory caches for performance gains.