对于网络应用程序来说,最佳的大容量本地存储选项是什么?
我正在使用 jquery mobile 构建一个网络应用程序,该应用程序将有大量需要缓存以供离线访问的图像,并且我正在寻找实现此目的的最佳方法。
我本来只是想为图像创建一个缓存清单文件,但是数量太多,并且超出了大小限制。我也考虑过Indexeddb,但它似乎还没有太多支持。
该解决方案需要适用于 Android 和 iOS,并且还可以在 Web 浏览器中访问。总存储容量可能需要大约 15-20 MB。有一个好的选择吗?
另外,我对网络应用程序没有太多经验,因此您可以提供的任何示例都会很棒。
I'm building a web app using jquery mobile that will have lots of images that need to be cached for offline access, and I'm looking for the best way to accomplish this.
I originally was just going to create a cache manifest file for the images, but there are too many, and they exceed the size limit. I also considered Indexeddb, but it doesn't seem to have much support yet.
The solution needs to work for both Android and iOS and also be accessible in a web browser. Total storage capacity will probably need to be around 15-20 MB. Is there a good option for this?
Also, I don't have much experience with web apps, so any examples you could provide would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Web SQL 数据库 (sqlite) 将为您提供 50MB 本地存储空间,适用于 Android 和 iOS
http://www.html5rocks.com/en/features/storage
这里有一个很好的库可以简化对 sqlite 的访问
https://github.com/jhubert/javascript-sqlite
The web sql database (sqlite) will give you 50MB local storage and works in Android and iOS
http://www.html5rocks.com/en/features/storage
There is a nice library that simplifies access to sqlite here
https://github.com/jhubert/javascript-sqlite
我认为对此没有什么好的解决方案。即使您使用并组合多种存储方法(包括标准浏览器缓存),您仍然不会接近 15MB。
我担心这将归结为专用应用程序和不在本地存储图像之间的选择。
I don't think there is any good solution for this. Even if you use and combine multiple storage methods (including the standard browser cache) you still won't get near to 15MB.
I fear this is going to come down to a choice between a dedicated app, and not storing the images locally.