I use AlamofireImage in my project quite a lot, and I use
let URL = NSURL(string: "https://cdn.domain.com/profile/image.jpg")! imageView.af_setImageWithURL(URL)
to get an image from my CDN. I have done some tests, but will correct me if I am wrong, this seems to save the loaded image in cache. My tests included uploading a 5 megabyte image. The first time it took about 20 seconds, the second time was instant.
I would like to know how can I clear the cache for a specific URL / image and reload the image?
Say, for example, Iβm updating a user profile profile. The name / URL of the image will be exactly the same, but I know the image has changes as the user selected a new image from his library or camera. I know that the image was successfully uploaded to the CDN since I can see the new image in the folder directly on the CDN.
source share