我使用这段代码将MP3文件下载到的文件目录:Alamofire:下载到文件高速缓存的大型文件的文件夹
let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory)
Alamofire.download(theUrl!, to:destination).response { response in
// stuff
}.downloadProgress { progress in
// Stuff
}
文件下载罚款,但如果我关闭应用程序并重新启动,下载从0重新开始。我想要的是文件被立即缓存和提取。 我对Alamofire的理解是,该文件被下载到一个临时文件夹,然后移动到Documents文件夹,这是什么导致缓存不发生?
非常感谢