mkdir before write file when save cache file