问题描述
限时送ChatGPT账号..首先,我有一个基本的英语水平,所以我希望你能理解.
First of all, I have a basic level of English so I hope that you understand.
React Native WebView 中的 incognito 和 cacheEnabled 属性有什么区别?react-native-webview doc没有详细解释.
What is the difference between incognito and cacheEnabled props in React Native WebView? react-native-webview doc don't have a detailed explanation.
隐身在 WebView 的生命周期内不存储任何数据.
缓存启用设置 WebView 是否应使用浏览器缓存.
推荐答案
基于源码,iOS和Android的功能不同:
Based on the source code, the functionality is different between iOS and Android:
iOS:
使用 WKWebsiteDataStore.nonPersistent
,它不向磁盘存储任何内容.
Uses WKWebsiteDataStore.nonPersistent
, which does not store anything to the disk.
安卓:
从CookieManager
中删除所有 cookie.清除所有缓存、表单、密码等并禁用缓存将缓存模式设置为 LOAD_NO_CACHE
(始终来自网络)
Removes all cookies from CookieManager
.
Clears all caches, forms, password etc. and disables caching
Sets cache mode to LOAD_NO_CACHE
(always from network)
除第一步之外的所有内容也适用于 cacheEnabled=false
.我不确定 WKWebView
中的缓存是如何工作的.默认情况下,它可能不会缓存任何内容,这意味着隐身功能与 Android 一致.cacheEnabled=true/false
在 iOS 中什么都不做.
All other than the first step also apply to cacheEnabled=false
. I'm not sure how caching works in WKWebView
. It may not cache anything by default, which would mean the incognito functionality is inline with Android. cacheEnabled=true/false
does nothing in iOS.
这篇关于React Native WebView 中的 incognito 和 cacheEnabled 道具有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论