From 1ccd3d732d7bf966c92ea4dab14b97c82b1ecade Mon Sep 17 00:00:00 2001 From: self-similarity <137652432+self-similarity@users.noreply.github.com> Date: Wed, 11 Oct 2023 23:06:22 +0000 Subject: [PATCH] Reduce image cache to 100mb (#683) * Reduce image cache to 100mb --- .../main/java/com/lagradost/cloudstream3/utils/GlideApp.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/GlideApp.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/GlideApp.kt index 4b0ee890..8d73db3d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/GlideApp.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/GlideApp.kt @@ -8,6 +8,7 @@ import com.bumptech.glide.Registry import com.bumptech.glide.annotation.GlideModule import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader import com.bumptech.glide.load.engine.DiskCacheStrategy +import com.bumptech.glide.load.engine.cache.InternalCacheDiskCacheFactory import com.bumptech.glide.load.model.GlideUrl import com.bumptech.glide.module.AppGlideModule import com.bumptech.glide.request.RequestOptions @@ -27,6 +28,10 @@ class GlideModule : AppGlideModule() { RequestOptions() .diskCacheStrategy(DiskCacheStrategy.ALL) .signature(ObjectKey(System.currentTimeMillis().toShort())) + }.setDiskCache { + // Possible to make this a setting in the future. + val memoryCacheSizeBytes: Long = 1024 * 1024 * 100; // 100mb + InternalCacheDiskCacheFactory(context, memoryCacheSizeBytes).build() } }