Mobile Safari 5mb HTML5 application cache limit?
It's becoming evident in my testing that there's a 5mb si开发者_如何学Pythonze limit on Mobile Safari's implementation of HTML5's application cache.
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.
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.
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?".
I think I got what the way iOS do:
- 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...)
Hope that useful for you.
This won't apply to the particular offline-video use case, but you can create 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.
Also contacted apple about this.
Read my blogpost about this here: http://techblog.viewbook.com/2011/02/mobile-safari-offline-application-cache-limit/
And my StackOverflow post here: Max size iPad / iPhone Offline Application Cache
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
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.
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.
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.
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.
To the best of my knowledge, there is no limit to the size of web apps.
http://www.apple.com/webapps/
精彩评论