Offline IndexDB vs Browser Eviction
Asked Answered
T

0

8

I'm puzzled by the juxtaposition of pitching IndexDB for offline (e.g.) single-page HTML apps with the fact that the documentation seems to indicate the browser can trash your local data at any time. "In addition, be aware that browsers can wipe out the database, such as in the following conditions"...

It seems like the options are

  • a) only design read-only offline apps or
  • b) just accept that once in a while some users of your offline app are going to get unlucky and lose all their work when the browser gets in a mood to delete your IndexedDB data.

My question is: is there any serious discussion of this issue anywhere, or (better, but too much to hope for) a serious read/write offline app that deals with the issue? My searches on the topic have been fruitless. For example, this complete offline todo app example manages to never mention the problem -- who wants to store even simple todo data in a storage that the browser could wipe out at any moment and that can't trivially be backed up?

Trillium answered 20/3, 2017 at 20:37 Comment(2)
Alas, after posting, I see Making localStorage and/or IndexedDB data offline permenent?, which may indeed be the only answer (need quota API not yet widely implemented). Still since there are multiple years of people touting offline apps, I'll leave this question up in case there is some lovely hack in common usage that people are using until a quota API can be relied on.Trillium
In practice, I've never seen a browser wipe out IndexedDB data, even though technically they are allowed to by the spec.Dambro

© 2022 - 2024 — McMap. All rights reserved.