mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Revert "skyshell: disable cache for now"
This reverts commit 9b03c575a4e12f80739d1de7d2c6d66a7cdb214a. https://codereview.chromium.org/999253005 I've not seen the stale caching behavior. I think we need to debug that and fix it. Living with out the cache causes very long load times in SkyShell. R=ianh@google.com Review URL: https://codereview.chromium.org/1086233002
This commit is contained in:
parent
465c66d337
commit
f25edfd741
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user