Only cache when directory exists