Properly cache directories in the node