【发布时间】:2017-01-19 18:50:42
【问题描述】:
我有一点问题。我得到了缓存以使用以下URL:
let URL = NSURL(string: "https://raw.githubusercontent.com/onevcat/Kingfisher/master/images/kingfisher-\(indexPath.row + 1).jpg")!
但是不能让它像这样使用URL:
FIRStorage.storage().reference().child("\(productImageref!).png").downloadURLWithCompletion({(url, error)in
if error != nil{
print(error)
return
}else{
cell.snusProductImageView.kf_setImageWithURL(url , placeholderImage: nil,
optionsInfo: [.Transition(ImageTransition.Fade(1))],
progressBlock: { receivedSize, totalSize in
print("\(indexPath.row + 1): \(receivedSize)/\(totalSize)")
},
completionHandler: { image, error, cacheType, imageURL in
print("\(indexPath.row + 1): Finished")
})
}
})
我在这里做错了什么?你能指出我正确的方向吗?对于缓存,我使用 3rd 方库“KingFisher”
编辑:Firebase 人 Mike McDonald 的名言
“Github 有 Cache-Control: max-age=300 而 Firebase 存储 默认没有设置缓存控制(你可以在你设置 上传文件,或通过更新元数据来更改它),所以我假设 这就是 KingFisher 不缓存它的原因。”
KingFisher 所有者quotes。
【问题讨论】: