Ionic Android 应用程序在缓存达到 10.3MB 后停止存储

Ionic Android app stops storing after cache reaches 10.3MB

我为客户构建了一个 Ionic 应用程序,使他能够拍照并使用 LocalStorageService 存储照片。他报告说,一旦应用程序的缓存达到 10.3 MB,他拍摄的照片将不再存储。

删除应用程序的缓存后,他会擦除他拍摄的所有照片,然后可以继续添加新照片。

我在我的设备上试过了,无法重现这个问题。我正在使用带有 Marshmallow 的三星 S6,而客户使用的是便宜的平板电脑 运行 Lollipop。我在这里遗漏了什么吗?

由于 LocalStorage 基本上是 cookie 的一种高级形式,它并不意味着存储大小为 MB 的文件或文件(当然不是图像)。大多数时候,Chrome 提供 10MB 的 space 而 Firefox 提供 5MB(基于此 article)。但是,不能保证,因为它没有在他们的文档中指定。它们的大小从 2 MB 到无限。

I am using a Samsung S6 with Marshmallow while the client is using a cheap tablet running Lollipop. Am I missing something here?

  • 正如我所说,这两个设备的 LocalStorage 容量可能有所不同。 (How to check LocalStorage size)

您可以使用 File Transfer Plugin and store the image files on your device. Once you that, you can then use LocalStorage or SQLite 来跟踪用户下载的图像的路径。