2

您好,我们使用 Adob​​e DPS 已经有一段时间了,我们刚刚开始使用 html 来支持一些更高级的交互。所以我们将本地的 html & assets 插入到 webview 中。

更新这些文件时,webview 不会更新。看起来 webview 非常难以缓存所有内容(html/css/js/images)。

有什么方法可以防止这些 webview 仅出于开发目的而缓存?

4

2 回答 2

0

您也可以尝试在 HTML 中添加以下 Meta 标签

<meta http-equiv="Cache-control" content="no-cache">
于 2014-09-05T16:20:13.457 回答
0

you can use location.reload(true) in your javascript to trigger a hard refresh. the first argument specifies that the reload should be a "hard refresh"

Obviously you can't call it on page load or you'll end up with an infinite loop of reloads, but you could add a development-only button in the page along the lines of:

<button onclick="location.reload(true);">hard refresh</button>
于 2013-10-16T19:29:42.363 回答