fix: prefer caching the final version (#283)

While caching the original and the final seems like an ideal way to reduce overhead, you cache an original copy of the image and the modified copy of the image to only ever load the modified copy. The size is set, meaning you are not reusing the original image. There is no reason to cache it.
This commit is contained in:
TwistedUmbrellaX 2024-03-23 21:07:02 -04:00 committed by GitHub
parent 85ef4b3c12
commit fa6e3a34b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1298,7 +1298,7 @@ fun blurImage(imageView: ImageView, banner: String?) {
val url = PrefManager.getVal<String>(PrefName.ImageUrl).ifEmpty { banner } val url = PrefManager.getVal<String>(PrefName.ImageUrl).ifEmpty { banner }
Glide.with(context as Context) Glide.with(context as Context)
.load(GlideUrl(url)) .load(GlideUrl(url))
.diskCacheStrategy(DiskCacheStrategy.ALL).override(400) .diskCacheStrategy(DiskCacheStrategy.RESOURCE).override(400)
.apply(RequestOptions.bitmapTransform(BlurTransformation(radius, sampling))) .apply(RequestOptions.bitmapTransform(BlurTransformation(radius, sampling)))
.into(imageView) .into(imageView)
} }