-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Working with Web Storage Quotas (Guide) #3466
Description
Old article:
http://www.html5rocks.com/en/tutorials/offline/quota-research/ (this was A+ at the time. we don't currently have anything more recent in /web)
Recent related one:
https://developers.google.com/web/updates/2011/11/Quota-Management-API-Fast-Facts?hl=en
There's also more info on Chrome's Quota nuance over in: https://docs.google.com/presentation/d/11CJnf77N45qPFAhASwnfRNeEMJfR-E_x05v1Z6Rh5HA/edit
PouchDB quota stats from https://pouchdb.com/faq.html:
IDB: Though Firefox has no upper limit besides disk space, if your application wishes to store more than 50MB locally, Firefox will ask the user using a non-modal dialog to confirm that this is okay.
Chrome also uses IndexedDB, and it determines the amount of storage available on the user’s hard drive and uses that to calculate a limit.
Opera 15+ shares a codebase with Chromium/Blink, and behaves similarly.
Internet Exporer 10+ has a hard 250MB limit, and will prompt the user with a non-modal dialog at 10MB.
Mobile Safari on iOS has a hard 50MB limit, whereas desktop Safari has no limit. Both will prompt the user with a modal dialog if an application requests more than 5MB of data, at increments of 5MB, 10MB, 50MB, 100MB, etc. Some versions of Safari have a bug where they only let you request additional storage once, so you'll need to request the desired space up-front. PouchDB allows you to do this using the size option.
iOS Web Application, a page saved on the homescreen behaves different than apps in Mobile Safari (at least from iOS 9.3.2+). No specifics are published online by Apple, but WebSQL storage seems not limited to 50mb and there will not be any prompts when requesting data storage. Use in your html header and use Add to Home Screen in the share menu of Safari. Please note, IndexedDB is not available, so FruitDown won't work. It seems there is different behaviour for different models of iPad and iPhone. You can check your mileage using the storage abuser, which you can Add to Home Screen on your device. Caveat: when iOS is running low on storage space, the OS might decide to delete all data without any notice or warning to the end user. Be sure to use devices with plenty of spare space, or your users will lose unsynced data.
Android works the same as Chrome as of 4.4+ (IndexedDB), while older versions can store up to 200MB (WebSQL).
In PhoneGap/Cordova, you can have unlimited data on both iOS and Android by using the SQLite Plugin.
My recent post with some quota related bits:
https://medium.com/dev-channel/offline-storage-for-progressive-web-apps-70d52695513c#.qi4hx1qwg
cc @drufball. Initially assigning to @agektmr as he's had an interest in storage Quota in the past and wrote the original guide linked to above.