简体   繁体   English

iOS Safari/WebKit PWA 持久性的当前状态,截至 15.2 版

[英]iOS Safari/WebKit current state of PWA persistence as of version 15.2

I am reevaluating PWA feasibility for mostly offline based, occasionally used applications.我正在重新评估 PWA 对大多数基于离线、偶尔使用的应用程序的可行性。 So far I had experience that PWAs on iOS does not have permanent storage as the website allocated space is often subject to cleanup either due to lack of space on a device or after N (I guess 7) days of application/website inactivity.到目前为止,我的经验是,iOS 上的 PWA 没有永久存储空间,因为网站分配的空间通常由于设备空间不足或应用程序/网站不活动 N(我猜 7)天后需要清理。 I am aiming for fully installed PWA's (homepage).我的目标是完全安装 PWA(主页)。

According to mozilla docs Safari should from version 15.2 fully implement the StorageManager persist API.根据mozilla 文档,Safari 应该从 15.2 版开始完全实现 StorageManager persist API。 On the other hand I have not found such a statement in Safari release notes .另一方面,我在Safari 发行说明中没有找到这样的声明。

Can someone confirm or disconfirm the persistence of PWA's on iOS?有人可以确认或不确认 PWA 在 iOS 上的持久性吗?

Without full persistence occasionally used offline ready PWA applications on iOS are no go zone.如果没有完整的持久性,偶尔在 iOS 上使用离线就绪的 PWA 应用程序是不可行的。 The only remaining alternative remains cordova or capacitor then.剩下的唯一选择仍然是科尔多瓦电容器 Or other more exotic solutions then (like React Native ).或者其他更奇特的解决方案(比如React Native )。

Thanks.谢谢。

I have not seen a definitive source, but this rather wordy article about PWA's on IOS says:我还没有看到明确的消息来源,但是这篇关于 IOS 上 PWA 的冗长文章说:

"There is a 50MB service worker cache limit, but that does not mean you cannot persist more data. IndexedDB allows you to store a few GBs of data. It really depends, like other platforms, on the available space. “有一个 50MB 的 service worker 缓存限制,但这并不意味着你不能保存更多数据。IndexedDB 允许你存储几 GB 的数据。它真的像其他平台一样取决于可用空间。

There is no native add to homescreen prompt, but other than Chrome and Edge no one else does either.Unused web apps that have not been added to the homescreen will have their cached assets purged after 7 days.没有原生的添加到主屏幕提示,但除了 Chrome 和 Edge 之外,其他人也没有。未添加到主屏幕的未使用 Web 应用程序将在 7 天后清除其缓存资产。 This is less of a problem than most think."这不是大多数人想象的问题。”

The key is "added to the home screen" for iOS Safari - per this. iOS Safari 的键是“添加到主屏幕”的——根据这个。

But I don't see a definitive answer from Apple.但我没有看到苹果给出明确的答案。

/https://love2dev.com/pwa/ios/ /https://love2dev.com/pwa/ios/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM