I am using the SDWebImage
library to cache web images in my app:
https://github.com/rs/SDWebImage/blob/master/README.md
Current Usage:
Below is what I have observed.
If the image name/ path is same, SDWebImage will not download it again for 1 week.
Irrespective of Image name, SDWebImage will re-download the image after 1 week (from the time it is downloaded).
static NSInteger cacheMaxCacheAge = 60*60*24*7; // 1 week
They have one Database where all images URL are stored. For them, image URL is like primary key (unique key).
So basically what they do is if the URL is changed and not present in DB, download it.
From my point of view what they are doing is RIGHT. Ex. If you upload image let's say for user A, the image name has to be changed & this is basic. I know some developer prefer image name to be same (like userA.png always).