如何清除在钛的WebView缓存? [英] How to clear the cache in a Titanium WebView?

查看:250
本文介绍了如何清除在钛的WebView缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

var webView = Ti.UI.createWebView({
        url: pUrl,
        autoDetect: [ Ti.UI.AUTODETECT_NONE ]
});

我只需要清除该变种web视图的缓存。我GOOGLE,发现一堆类似的问​​题,但解决方案实际上并不清除缓存,因为(据我所知) ,有钛的的WebView来清除它的缓存中没有内置函数或方法。为什么我需要清空缓存的原因是我需要清除用户帐户的用户名和密码。的只是为了更多的信息,我使用这个web视图中的Andr​​oid。

I just need to clear the cache of this var webView. I've googled and found a bunch of similar questions but solutions don't actually clear the cache since (as far as I know), there's no built-in function or method for Titanium's WebView to clear it's cache. The reason why I need to clear the cache is I need to clear the username and password of a user's account. Just for additional information, I'm using this webView in Android.

推荐答案

我不太确定是否能在钛清除缓存很容易,但也许你应该完全禁用它。看看 setCacheMode(CacheMode参数)中的文档。这种方法可以让你的缓存模式设置为这在的文档。其中之一是 Titanium.UI.Android.WEBVIEW_LOAD_NO_CACHE 这是preventing从缓存web视图。请注意,该酒店只适用于Android!

I am not quite sure whether you can clear the cache in titanium easily but maybe you should disable it completely. Have a look at setCacheMode(cacheMode) in the documentation. This method allows you to set the caching mode to one of several predefined modes which are described in the documentation. One of them is Titanium.UI.Android.WEBVIEW_LOAD_NO_CACHE which is preventing the webView from caching. Please note that this property only works on Android!

这篇关于如何清除在钛的WebView缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆