Use makedirs rather than mkdir for cache location.