React Native WebView 中的 incognito 和 cacheEnabled 道具有什么区别?

编程入门 行业动态 更新时间:2024-10-23 01:55:38
本文介绍了React Native WebView 中的 incognito 和 cacheEnabled 道具有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-26 04:31:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1129003.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有什么区别   道具   Native   React   WebView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!