pub fn write_cache(data: &CacheData, path: &Path) -> Result<(), CacheError>
Write cache data to a file.