gpt4 book ai didi

android - WebSettings 的 LOAD_DEFAULT 和 LOAD_NORMAL 之间有什么区别?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:13:36 27 4
gpt4 key购买 nike

我有一个 WebView Activity ,想要缓存内容。默认情况下,它似乎没有使用缓存。

Android 的 WebSettings有几个不同的缓存相关常量。

当我将缓存模式设置为“LOAD_CACHE_ELSE_NETWORK”时,它似乎在使用缓存。但是,我不想使用过期的缓存内容。

这让我只能使用:

  1. LOAD_DEFAULT:“默认缓存使用模式”或
  2. LOAD_NORMAL:“正常缓存使用模式”

但文档没有详细说明“正常”和“默认”的含义。

这两种模式有何不同?

最佳答案

我同意,人们会认为 NORMAL_MODE 是默认模式,但显然这是两个不同的值。

我认为问题 2 的答案。(LOAD_NORMAL) 在 documentation for WebSettings.setCacheMode(int mode) 中得到了回答。

For a normal page load, the cache is checked and content is re-validated as needed. When navigating back, content is not revalidated, instead the content is just pulled from the cache. This function allows the client to override this behavior.

关于android - WebSettings 的 LOAD_DEFAULT 和 LOAD_NORMAL 之间有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6495225/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com