WebView has two types of cache: webpage data cache (storing opened pages and resources) and H5 cache (appcache ). 1. webpage cache 1. cache Composition/data/package_name/cache/data/package_name/database/webview. db/data/package_name/database/webviewCache. db 2. the cache mode is hard to understand in the following two modes: LOAD_DEFAULT, which determines whether to retrieve data from the Network Based on cache-control. LOAD_CACHE_ELSE_NETWORK: cache data is used as long as it exists locally, whether it expires or not, or no-cache. For example, m.taobao.com's cache-control is no-cache. In the LOAD_DEFAULT mode, data is retrieved from the network in any case. If there is no network, an error page is displayed; in LOAD_CACHE_ELSE_NETWORK mode, cache is used no matter whether the network exists or not. M.sina.com.cn's cache-control is max-age = 60, and local cache data is used in both modes. Conclusion: Based on the above two modes, the cache policy is recommended to determine whether a network exists. If yes, LOAD_DEFAULT is used. If no network exists, LOAD_CACHE_ELSE_NETWORK is used. 3. Clear cached AchE (boolean ). CacheManager. clear. In a later version, you must call the hidden API. 4. No system API support for controlling the size. Optional: regularly calculates the cache size and deletes the cache in chronological order. Ii. H5 cache 1. The Cache consists of cache files generated during H5 cache process according to the path provided by setAppCachePath (String appCachePath. 2. Select the cache mode with no mode. Use setAppCacheEnabled (boolean flag) to set whether to enable the mode. Disabled by default, that is, H5 cache cannot be used. 3. Clear the cache. Find the cache path set by calling setAppCachePath (String appCachePath) and delete all the files under it. 4. Set the Maximum Cache capacity through setAppCacheMaxSize (long appCacheMaxSize). The default value is Max Integer. In addition, you may overwrite WebChromeClient. onReachedMaxAppCacheSize (long requiredStorage, long quota, WebStorage. QuotaUpdater quotaUpdater) to set the policy when the cache exceeds the previously set maximum capacity. 3. refer to the following URL for some information about H5 cache. For example, each Application only calls WebSettings once. setAppCachePath (), WebSettings. setAppCacheMaxSize () is ignored and other issues need to be carefully read and tested. Http://code.google.com/p/android/issues/detail? Id = 24180