What is the maximum size of a Web SQL DB in iOS (Safari) on the iPad? How about LocalStorage?

别等时光非礼了梦想. 提交于 2019-12-05 00:07:59

问题


What is the maximum data size when using HTML5's Web SQL to store data locally on the iPad?

When you reach that, does it just prompt the user to increase it? Is that a simple yes/no permission request? If so, what's the hard limit (beyond which there isn't even the option of the user allowing it to expand)?

Does LocalStorage work the same way?


回答1:


The total limit for all WEB SQL Databases created by your site on Mobile Safari is 50Mb. Users are asked to confirm acceptance above 5Mb and you cannot later increase the size of an existing database, you can only create a new, secondary, db, so you have to plan well and set the size when you first create the db.

var theBiggestDB = openDatabase('databaseName', '1.0', 'My Database', 50*1024*1024);

See this answer: https://stackoverflow.com/a/6281947/1233018




回答2:


After 5MB, I believe it prompts the user if they would like to allocate more space. That's for WebSQL.

There is no maximum limit to the size, as far as I've seen.




回答3:


For HTML5 Application Cache limit is 50 MB. I tried following manifest (more than 50MB in total)

CACHE MANIFEST

CACHE:
icon.gif
font.ttf
index.htm
5mb.mp4
7_4mb.mp4
19mb.mp4
19_1mb.mp4

And it says "Application cache update failed because size quota was exceeded"

If I change manifest to following (less than 50MB in total)

CACHE MANIFEST

    CACHE:
    icon.gif
    font.ttf
    index.htm
    # 5mb.mp4
    7_4mb.mp4
    19mb.mp4
    19_1mb.mp4

It asks me to increase application cache size to 50MB and save all data correctly.

Tested it on iPad, iPad 2, The new iPad

For WEB SQL storage should be the same limit.



来源:https://stackoverflow.com/questions/10985959/what-is-the-maximum-size-of-a-web-sql-db-in-ios-safari-on-the-ipad-how-about

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!