6 ms·
> browsers may delete your IndexedDB database under certain conditions Safari will happily delete your IndexedDB database after 7 days of inactivity. It delet
by lioeters 5y ago
> browsers may delete your IndexedDB database under certain conditions
Safari will happily delete your IndexedDB database after 7 days of inactivity.
It deletes "all of a website’s script-writable storage after seven days of Safari use without user interaction on the site". That includes:
- Indexed DB
- LocalStorage
- Media keys
- SessionStorage
- Service Worker registrations and cache
Source: https://webkit.org/blog/10218/full-third-party-cookie-blocking-and-more/ https://webkit.org/blog/10218/full-third-party-cookie-blocki...
Found via: The pain and anguish of using IndexedDB: problems, bugs and oddities - https://gist.github.com/pesterhazy/4de96193af89a6dd5ce682ce2adff49a https://gist.github.com/pesterhazy/4de96193af89a6dd5ce682ce2...
- jlongster 5y agoYep, this is the biggest problem (although I haven't seen it happen after 7 days, at least on desktop). We will provide a new backend for the Storage Foundation API when it's available.
- mst 5y agoClearly the solution to this is to keep a query log in an extra table and periodically stream that to the server as a form of logical replication (plus perhaps being able to load the initial database state from the server side as well, maybe even on-demand using the GH pages trickery until a write forces materialisation into IndexedDB). As a bonus point this effectively adds yet another level of "Yo, Dawg" which I can't not love just as a matter of principle.
- jlongster 5y agoPeople are already trying to get me to hook up https://litestream.io/ https://litestream.io/ to it
- adam12 5y agoTim Cook basically lied to Congress when he stated that developers can create web apps as an alternative to using the app store. Edit: In order for this to be true, Apple (at the very least) needs to enable push notifications and an install prompt for progressive web apps.
- da_chicken 5y agoI mean, he's correct in the same sense that a Buick can't be made to haul a fifth wheel trailer. It's because a modern Buick's design doesn't include the bed required to install the fifth wheel on. Nevermind that there's nothing strictly stopping GM from changing the designs for Buicks to include a vehicle capable of a fifth wheel mount.
- enkrs 5y agoIf you add the website to homescreen (make it an “app”) then the 7 day storage limit does not apply. This makes total sense to me, and I’m happy Facebook can’t store tracking data in my Safari for longer than 7 days.
- conductr 5y ago> I’m happy Facebook can’t store tracking data in my Safari for longer than 7 days. They’re storing it somewhere, no? I feel like the benefit here is more so the browser file system doesn’t get bloated
- SilverRed 5y agoClearing site data makes total sense. Otherwise after a year of web usage you have multiple GB of stored website data that the user does not know what it is being used for or how to clear it. And the majority of uses for local data is to cache fetched data or store temporary preferences not worthy of being in the server side database.
- andrewcl 5y agoI'd assume Tim has a different definition of what an app is than what you're thinking of.
- cosmie 5y agoPWA are explicitly exempt from the data storage wipe behavior[1]. So there's that, at least. For now. Although I agree that it's a fairly minor win in the grand scheme of how handicapped PWA's are on iOS. And like you said, the lack of install prompts and tucking away the PWA "installation" option in the share menu makes it less than intuitive and requires manual awareness efforts by devs[2]. [1] Last section of https://webkit.org/tracking-prevention/ https://webkit.org/tracking-prevention/ [2] https://michaellisboa.com/blog/prompt-ios https://michaellisboa.com/blog/prompt-ios
- lowwave 5y agoI wish every browser does that! Web site has no business storing data on my computer more than 4093 bytes (that is already too much) per domain in my computer just because I visited a web page. 10 MB - 10GB of data is too much.
- sroussey 5y agoYes, send all your data to someone’s server instead.
- tshaddox 5y agoIf you're concerned about a web site silently having access to personal data from your phone, surely it doesn't matter whether that web site is storing it silently in your device's browser storage, or storing it on the web site's servers. If, on the other hand, you're explicitly uploading or entering data on a web site, well then yes, the default assumption would certainly be that the data is getting saved on the web site's servers (if it's being saved at all). That's how the web has worked for a very long time, with the exception of cookies and a few other more recent but not widely known storage mechanisms which in most cases aren't considered sufficiently robust for persistent on-device storage.
- beebeepka 5y agoI think that's a valid concern. Stuff like this should only be allowed after a prompt where the user explicitly allows it, just like any other permission
- kitsunesoba 5y agoI would say it’s even more important in the case of a web app that stores data locally, because it’s imperative that the user understands that data is tied to that particular web browser and device, and that clearing site data (which I’ve known non-technical users to do periodically to reduce tracking footprint), changing devices, etc can/will result in data loss. Oddly enough the handful of web apps I’ve known to use local storage don’t communicate this at all. Developers seemingly treat data in browser local storage as existing indefinitely and unlikely to be deleted, when in fact it’s probably the most easily accidentally lost form of storage an app can have.
- derefr 5y agoI would point out that the article you linked mentions that webapps "added to the home screen" on iOS Mobile Safari are exempt from this garbage-collection process. In such a case, the "add to the home screen" step is being taken as the user expressing the explicit desire to have that data around indefinitely. Which seems sensible to me; webapps should be treated as ephemeral-by-default, and only be allowed persistent storage if the user goes to lengths (i.e. beyond just clicking "Accept" on a modal) to express their desire to keep the data. (And also, I've observed that webapps that notice they're on an iOS device can insist on being "added to the home screen" before they'll do anything, and so ensure their data stays around.) The problematic aspect of this, is that there's no equivalent of this "exemption by user explicitly expressing the desire to keep the app around" for non-mobile Safari. Maybe for desktop Safari, the data should be kept around if the web app's rel="canonical" URL is bookmarked in the browser? Or desktop Safari could just support regular Progressive Web App standards, and so show an "Install App" indicator (like e.g. desktop Chrome does for this webapp: https://www.soundslice.com/ https://www.soundslice.com/). But I have a feeling Apple will never support this on desktop...
- tarsinge 5y agoPWA are not a standard, they are a Google concept pushed through Chrome (OS). I’m fine with Apple never supporting it.
- mst 5y agoSo long as I can also use them in firefox they're 'unstandardised but not single vendor' and at that point I'm not as troubled about it.
- TingPing 5y agoFirefox doesn't support PWAs...
- mst 5y agoThey don't support the same precise system, but you can e.g. definitely do installable apps on Firefox for Android: https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Installable_PWAs https://developer.mozilla.org/en-US/docs/Web/Progressive_web...
- mschuster91 5y agoSo that is why a website I work on has complaints of Apple users who keep getting nagged by cookie banners - they store their settings in LocalStorage since cookies tend to have issues when the content is too long. Thank you so very much.
- tarsinge 5y agoAs a Safari user I’m really happy with that behavior, it avoids the hassle of manually purging it regularly. Also in my opinion websites have no business storing data on my device through a browser. If I want that behavior I would use a native app.
- vlunkr 5y agoThis is why I haven't used LocalStorage or any other browser storage solution for a long time. They seem really cool, but if they will just get wiped by some browsers, then what is the point? As of a couple of years ago, localStorage didn't work at all in a private windows in safari. Unless you have some very specific needs, I don't know how you would every use IndexedDB
- ciex 5y agoBut doesn't this 7 day limit only apply if you load a third party script that uses IndexedDB into your site? Webkit says in your source: > It is not the intention of Intelligent Tracking Prevention to delete website data for first parties in web applications.
- warvstar 5y agoI assume that also includes the Cache API's Storage?
- mr_toad 5y agoIf webSQL were a thing, that list would include webSQL data too.