0

I'm loading my images in my UICollectionView with UIImageView+WebCache category. I'm using the option SDWebImageRefreshCached:

[cell.imageView
 setImageWithURL:url
 placeholderImage:nil
 options:SDWebImageRefreshCached | SDWebImageRetryFailed
 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) 
{
    if (error) NSLog(@"Error loading image");
}

The Cache-Control of the image is public, max-age=604772. If I activate the airplane mode, I get the "Error loading image" message.

Why is SDWebImage trying to connect the web server every time, although the max-age is set to 1 week?

Ralf Hundewadt
  • 1,078
  • 1
  • 13
  • 25

1 Answers1

0

SDWebImageRefreshCached ignores the cached image and will always try to get a fresh image from the url. Omit SDWebImageRefreshCached and the cached image will be used

Fraser
  • 953
  • 11
  • 21