| Index: sky/services/oknet/src/org/domokit/oknet/NetworkServiceImpl.java
|
| diff --git a/sky/services/oknet/src/org/domokit/oknet/NetworkServiceImpl.java b/sky/services/oknet/src/org/domokit/oknet/NetworkServiceImpl.java
|
| index ce30d856bad68eee5e211d1519262aab9a3726a1..f8b5b73d58bc021491e501d323e10a894dab85e2 100644
|
| --- a/sky/services/oknet/src/org/domokit/oknet/NetworkServiceImpl.java
|
| +++ b/sky/services/oknet/src/org/domokit/oknet/NetworkServiceImpl.java
|
| @@ -45,9 +45,19 @@ public class NetworkServiceImpl implements NetworkService {
|
| if (sThreadPool == null)
|
| sThreadPool = Executors.newCachedThreadPool();
|
|
|
| - if (sClient == null)
|
| + if (sClient == null) {
|
| sClient = new OkHttpClient();
|
|
|
| + try {
|
| + int cacheSize = 10 * 1024 * 1024; // 10 MiB
|
| + File cacheDirectory = new File(context.getCacheDir(), "ok_http_cache");
|
| + Cache cache = new Cache(cacheDirectory, cacheSize);
|
| + sClient.setCache(cache);
|
| + } catch (IOException e) {
|
| + Log.e(TAG, "Unable to create HTTP cache", e);
|
| + }
|
| + }
|
| +
|
| NetworkService.MANAGER.bind(this, pipe);
|
| }
|
|
|
|
|