【问题标题】:SDWebImage: Cache-Control Header is not usedSDWebImage:未使用缓存控制标头
【发布时间】:2015-06-05 11:31:38
【问题描述】:

我正在使用UIImageView+WebCache 类别将我的图像加载到我的 UICollectionView 中。我正在使用选项SDWebImageRefreshCached:

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

图片的缓存控制是public, max-age=604772。如果我激活飞行模式,我会收到“加载图像时出错”消息。

为什么 SDWebImage 每次都尝试连接网络服务器,尽管 max-age 设置为 1 周?

【问题讨论】:

    标签: sdwebimage


    【解决方案1】:

    SDWebImageRefreshCached 会忽略缓存的图像,并始终尝试从 url 获取新图像。省略 SDWebImageRefreshCached 会使用缓存的图片

    【讨论】:

      猜你喜欢
      • 2020-05-26
      • 2011-02-05
      • 2017-01-10
      • 2015-02-23
      • 2011-01-13
      • 1970-01-01
      • 2011-10-28
      • 2010-10-31
      • 2020-07-17
      相关资源
      最近更新 更多