Consider increasing WebView cache size |
|
Issue descriptionWebView's disk cache is currently hardcoded to 20MB - we should consider increasing it since that's pretty small on modern devices and has led to problems like issue 890973. Some things to think: 1) There are new APIs on O (see https://developer.android.com/reference/android/os/storage/StorageManager#getCacheQuotaBytes(java.util.UUID) for example) which provide suggestions for apps on how much cache space they can use, sized dynamically according to how often the app is used. We could roll out a UMA metric to see what values this has in the wild, and if it's typically much larger than 20MB, we could consider setting WebView's cache on O+ to some percentage of the app's total allowed cache size. We'd probably want to make sure the minimum size was still 20MB to avoid reducing it unexpectedly for any existing apps. 2) Does Chrome already have a UMA metric for available disk space? That might be interesting to check if so, to see whether that might be helpful to decide on a cache size dynamically for pre-O versions that don't have the quota APIs (though we could just leave it as-is there, also).
,
Oct 9
Maybe Chrome should also be using those new APIs on O :)
,
Dec 3
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4a0206d93d9ff03f88e0c6f98f12d1a490eb5109 commit 4a0206d93d9ff03f88e0c6f98f12d1a490eb5109 Author: Nate Fischer <ntfschr@chromium.org> Date: Mon Dec 03 20:18:13 2018 AW: refactor cache size into a getter method. No change to behavior, this only moves the value into a getter method for both code paths. This moves the cache size to a centrally-determined spot, since we may want to create more complex logic for the value we set. R=changwan@chromium.org Bug: 893318,887538 Test: None Change-Id: I0e22928bc37a247f165e3913b1e7007fa0d7a1f3 Reviewed-on: https://chromium-review.googlesource.com/c/1357331 Reviewed-by: Changwan Ryu <changwan@chromium.org> Commit-Queue: Nate Fischer <ntfschr@chromium.org> Cr-Commit-Position: refs/heads/master@{#613212} [modify] https://crrev.com/4a0206d93d9ff03f88e0c6f98f12d1a490eb5109/android_webview/browser/aw_content_browser_client.cc [modify] https://crrev.com/4a0206d93d9ff03f88e0c6f98f12d1a490eb5109/android_webview/browser/net/aw_url_request_context_getter.cc [modify] https://crrev.com/4a0206d93d9ff03f88e0c6f98f12d1a490eb5109/android_webview/browser/net_helpers.cc [modify] https://crrev.com/4a0206d93d9ff03f88e0c6f98f12d1a490eb5109/android_webview/browser/net_helpers.h |
|
►
Sign in to add a comment |
|
Comment 1 by pasko@chromium.org
, Oct 9