cache key collision
hello here, i've been trying something using this library, and encountered a weird behaviour, the following is a simpler version of the code i wrote.
VStack {
//... some code here
WebImage(url: URL(string: url)
).placeholder {
Rectangle().fill(Color(UIColor.systemGray6))
.frame(width: self.postWidth , height: self.postHeight)
.aspectRatio(contentMode: .fill)
.overlay(Text("Loading..."))
}.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: self.postWidth , height: self.postHeight)
.clipped()
.cornerRadius(4)
//... some code here too
}.background(
WebImage(url: URL(string: url)
, context: [.imageThumbnailPixelSize : CGSize(width: self.postWidth / 8 , height: self.postHeight / 8) ,]
).resizable()
.aspectRatio(contentMode: .fill)
.frame(width: self.postWidth , height: self.postHeight)
.clipped()
.blur(radius: 40)
)
.clipped()
my problem is that sometimes i get the low quality background image on top too. It seems like it's fetching the background low image for the top view too. maybe they are using the same cache key? or maybe i'm just writing rubbish... anyway can you please advice any solution for this problem? thank you in advance.
The thumbnail decoding feature (via .imageThumbnailPixelSize) will have different cache key even they share the same URL.
Sounds like a bug. Let me have a try to reproduce this issue.
yeah that's what is said in the documentation, but still i'm having that weird behaviour sometimes
Any update here?