Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is IndexedDB on Safari guaranteed to be persistent?

Similar to this question, is IndexedDB guaranteed to be persistent ? ie. Safari will not reclaim disk space if the device is low on memory.

like image 228
Matthieu Riegler Avatar asked Jun 11 '18 10:06

Matthieu Riegler


People also ask

How persistent is IndexedDB?

Even though IndexedDB is a fully functional client-side database for the web, it is not a persistent storage by default. IndexedDB without StorageManager is just a “best-effort” database that can be erased in situations of low disk space on a device.

Does IndexedDB work on Safari?

Thus, it's IndexedDB is actually provided by Safari even on Chrome, Opera or Firefox, see issue #110. If your application must target iPhone 6 or below, it is recommended to include the indexedDB shim before requiring/including Dexie. js. iPhone 7 users will have a Safari engine of version >= 10.3.

Is IndexedDB secure?

The short answer is IndexedDB is vulnerable to malware and physical takeover attacks. It's better than many options because cryptography is done outside the browser execution environment, but it's not totally secure.

Where is IndexedDB stored?

More specifically, IndexedDB data is stored in the browser profile folder.


1 Answers

Safari have "No Eviction policy", meaning it will not automatically clean the IndexDB on low disk pressure, without user doing it manually.

IndexDB is one of the fast evolving feature and you can expect to have a different eviction policy any time with no announcement. You should always build with fall back options.

Chrome has explicit persistent storage option which will guarantee no eviction, on user approval for persistent storage and we can expect Safari to do the same sometime, based on their track record of following Chrome in implementing PWA features(though its taking years with super bad documentation).

like image 140
Anand Avatar answered Nov 25 '22 14:11

Anand