package com.animedetour.android.framework.dependencyinjection.module;

import com.facebook.stetho.okhttp.StethoInterceptor;
import com.squareup.okhttp.OkHttpClient;
import dagger.Module;
import dagger.Provides;

import javax.inject.Singleton;

@Module(library = true, complete = false)
public class NetworkModule
{
    @Provides @Singleton OkHttpClient provideOkHttp()
    {
        OkHttpClient client = new OkHttpClient();
        client.networkInterceptors().add(new StethoInterceptor());

        return client;
    }
}

@@ -64,16 +64,48 @@
 odule;%0A%0A
+import android.app.Application;%0A
 import c
@@ -149,16 +149,50 @@
 ceptor;%0A
+import com.squareup.okhttp.Cache;%0A
 import c
@@ -301,16 +301,65 @@
 ngleton;
+%0Aimport java.io.File;%0Aimport java.io.IOException;
 %0A%0A@Modul
@@ -479,13 +479,60 @@
 ttp(
-)
 %0A   
+     Application application%0A    ) %7B%0A        try
  %7B%0A 
@@ -538,16 +538,20 @@
         
+    
 OkHttpCl
@@ -584,16 +584,243 @@
 ient();%0A
+            File cacheDir = new File(application.getCacheDir(), %22http%22);%0A            long cacheSize = 80 * 1024 * 1024; // 80MB%0A            Cache cache =  new Cache(cacheDir, cacheSize);%0A            client.setCache(cache);%0A    
         
@@ -887,16 +887,20 @@
         
+    
 return c
@@ -906,16 +906,103 @@
 client;%0A
+        %7D catch (IOException e) %7B%0A            throw new RuntimeException(e);%0A        %7D%0A
     %7D%0A%7D%0A

Add 80MB cache to OkHttpClient.