Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Caching Alamofire如何检测服务器上已更新的图像?_Caching_Swift2_Alamofire - Fatal编程技术网

Caching Alamofire如何检测服务器上已更新的图像?

Caching Alamofire如何检测服务器上已更新的图像?,caching,swift2,alamofire,Caching,Swift2,Alamofire,我使用alamofire下载和显示图像。缓存工作得很好,但当我更新同一url链接的图像时,它并没有反映我的应用程序上的更新。我如何解决这个问题?这是我用来显示图像的简短代码 let url = NSURL(string: "http://myserver.com/image/12345.png") Alamofire.request(.GET, url).responseData({ response in if let imageData = UIImage(data: response.

我使用alamofire下载和显示图像。缓存工作得很好,但当我更新同一url链接的图像时,它并没有反映我的应用程序上的更新。我如何解决这个问题?这是我用来显示图像的简短代码

let url = NSURL(string: "http://myserver.com/image/12345.png")

Alamofire.request(.GET, url).responseData({ response in

if let imageData = UIImage(data: response.result.value!) {
    self.testImageView.image = imageData
}
})

尝试禁用缓存:肯定需要缓存,但想知道如果图像上有相同url的更新,如何删除特定的缓存响应。