Create cache directory function