Html Mobile Safari 5mb HTML5 应用程序缓存限制?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2908459/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Mobile Safari 5mb HTML5 application cache limit?
提问by JFH
It's becoming evident in my testing that there's a 5mb size limit on Mobile Safari's implementation of HTML5's application cache.
在我的测试中很明显,Mobile Safari 对 HTML5 应用程序缓存的实现有 5mb 的大小限制。
Does anyone know how to circumvent or raise this? Is there some unexposed meta tag that I should know about? I have to cache some video content for an offline app and 5mb is not going to be enough.
有谁知道如何规避或提出这个问题?是否有一些我应该知道的未公开的元标记?我必须为离线应用缓存一些视频内容,5mb 是不够的。
回答by KimKha
I tried to write a simple test with this manifest:
我尝试使用此清单编写一个简单的测试:
CACHE MANIFEST
# 2010-06-20:v4
http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
http://peach.blender.org/wp-content/uploads/big_big_buck_bunny.jpg
http://apod.nasa.gov/apod/image/9712/orionfull_jcc_big.jpg
http://www.thelivingmoon.com/43ancients/04images/Titan/titan5km_huygens_big.jpg
http://upload.yeuamnhac.com/musica/dan_lily/dancontent/rh108poster1big.jpg
This cache will need 11.4MB of storage.
该缓存需要 11.4MB 的存储空间。
When I open a page include that manifest file, it say something like that: "This website require to use up to 25MB of storage, do you want to increase local storage?".
当我打开一个包含该清单文件的页面时,它会说这样的话:“这个网站需要使用最多 25MB 的存储空间,你想增加本地存储空间吗?”。
I think I got what the way iOS do:
我想我明白了 iOS 的做法:
- You only have 5MB for local storage (include HTML5 application cache)
- If your web need more, Safari need user's agreement for some packages (up to 10MB, or 25MB, or more...)
- 您只有 5MB 的本地存储空间(包括 HTML5 应用程序缓存)
- 如果您的网络需要更多,Safari 需要用户同意某些包(最多 10MB,或 25MB,或更多...)
Hope that useful for you.
希望对你有用。
回答by Liza Daly
This won't apply to the particular offline-video use case, but you cancreate Web SQL databases larger than the default 5MB in iOS by simply requesting a larger DB in the openDatabase
call. For some kinds of storage, SQLite can be an acceptable solution.
这不适用于特定的离线视频用例,但您可以通过在openDatabase
呼叫中简单地请求更大的数据库来创建大于 iOS 中默认 5MB 的 Web SQL 数据库。对于某些类型的存储,SQLite 是可以接受的解决方案。
回答by Rien
Also contacted apple about this.
也就此联系了苹果。
Read my blogpost about this here: http://techblog.viewbook.com/2011/02/mobile-safari-offline-application-cache-limit/
在这里阅读我的博文:http: //techblog.viewbook.com/2011/02/mobile-safari-offline-application-cache-limit/
And my StackOverflow post here: Max size iPad / iPhone Offline Application Cache
我的 StackOverflow 帖子在这里:Max size iPad / iPhone Offline Application Cache
回答by Leah
What else is on the page?
页面上还有什么?
These guys keep their pages under the limit by either splitting up the pages or replacing some of the cached images with links:
http://www.mobilenoter.com/blog/post/2010/04/06/Removing-size-limit-of-a-page.aspx
这些家伙通过拆分页面或用链接替换一些缓存的图像来保持他们的页面在限制之下:http:
//www.mobilenoter.com/blog/post/2010/04/06/Removing-size-limit-页面的.aspx
回答by Sukima
I ran a web app that was larger then 5MB on an iPad (iOS 5) although it is an iPad once the page loaded past 5MB it presented a pop-up asking the user if he/she wanted to increase the size of the cache to 10MB.
我在 iPad (iOS 5) 上运行了一个大于 5MB 的网络应用程序,尽管它是一个 iPad,一旦页面加载超过 5MB,它就会弹出一个弹出窗口,询问用户他/她是否想将缓存的大小增加到10MB。
I would appear that with the latest iOS version that if a web app needs more then 5MB of cache storage it will ask the user if it has permission to increase it so the user can manage his/her own memory space.
我认为在最新的 iOS 版本中,如果 Web 应用程序需要超过 5MB 的缓存存储,它会询问用户是否有权增加它,以便用户可以管理他/她自己的内存空间。
It would also stand to reason that when you view your usage data (say via iTunes) the amount you see in the "Other" category is probably web cache mostly. Also you can see how much space is being used per website by going to Settings | Safari | Advanced | Website Data.
当您查看您的使用数据(例如通过 iTunes)时,您在“其他”类别中看到的数量可能主要是网络缓存。您还可以通过转到“设置”|“查看每个网站使用了多少空间”。野生动物园 | 高级 | 网站数据。
回答by mattbasta
Not sure why every forgets about the good 'ol Web apps (remember these guys? they were around before native apps!), but they're already "offline ready," which means that you don't need to load up your application cache with every component of your app.
不知道为什么每个人都忘记了好的 'ol Web 应用程序(还记得这些家伙吗?它们出现在原生应用程序之前!),但它们已经“离线准备好了”,这意味着您不需要加载应用程序缓存与您的应用程序的每个组件。
To the best of my knowledge, there is no limit to the size of web apps.
据我所知,Web 应用程序的大小没有限制。