From aa5eb9f99acc0cdc4b9ab0c6085d398f31acaed0 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sat, 14 Jul 2018 17:12:57 +0200 Subject: [PATCH] increase cache size & dont cache full size media (#710) --- .../com/keylesspalace/tusky/fragment/ViewMediaFragment.java | 1 + app/src/main/java/com/keylesspalace/tusky/util/OkHttpUtils.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewMediaFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewMediaFragment.java index 0ee0015b4..26600b9c1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewMediaFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewMediaFragment.java @@ -209,6 +209,7 @@ public final class ViewMediaFragment extends BaseFragment { Picasso.with(getContext()) .load(url) .noPlaceholder() + .networkPolicy(NetworkPolicy.NO_STORE) .into(photoView, new Callback() { @Override public void onSuccess() { diff --git a/app/src/main/java/com/keylesspalace/tusky/util/OkHttpUtils.java b/app/src/main/java/com/keylesspalace/tusky/util/OkHttpUtils.java index 7ca058792..2a9500d9e 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/OkHttpUtils.java +++ b/app/src/main/java/com/keylesspalace/tusky/util/OkHttpUtils.java @@ -92,7 +92,7 @@ public class OkHttpUtils { specList.add(fallback); specList.add(ConnectionSpec.CLEARTEXT); - int cacheSize = 10*1024*1024; // 10 MiB + int cacheSize = 25*1024*1024; // 25 MiB OkHttpClient.Builder builder = new OkHttpClient.Builder() .addInterceptor(getUserAgentInterceptor())