W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2015

Re: [whatwg] Persistent and temporary storage

From: Janusz Majnert <jmajnert@gmail.com>
Date: Sun, 15 Mar 2015 23:18:25 +0100
Message-ID: <CAOeF0ewXPTLaXyowysrt+fRv07=mW4nFSt4HT6TkBMcSiYR-FQ@mail.gmail.com>
To: Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net>
Cc: whatwg@lists.whatwg.org, Janusz Majnert <j.majnert@samsung.com>
2015-03-13 21:39 GMT+01:00 Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net>:
> Janusz Majnert <j.majnert@samsung.com> writes:
>
>> On 13.03.2015 15:01, Anne van Kesteren wrote:
>>> On Fri, Mar 13, 2015 at 2:58 PM, Janusz Majnert <j.majnert@samsung.com> wrote:
>>>> The real question is why having a quota is useful?
>>>
>>> The reason developers want it is to know how much they can download
>>> and store without getting an exception.
>>>
>>
>> Which still doesn't guarantee they won't get an exception if the device
>> runs out of space for whatever reason.
>>
>
> There exists also an issue of perverse incentives. If the browser tells
> an application how much storage it can use, an application developer is
> likely to try to use the maximum allowed space. This could also lead to
> web apps refusing to run if an user agent does not report enough space.

Just another reason not to expose quota information, but instead have
heuristics to calculate "reasonable" limit. When app reaches this
limit user should be nudged (not prompted) by UA to investigate and/or
set a hard limit, delete data, etc.
The heuristics may take into account:
* how often the site is visited
* is the site bookmarked or installed (via W3C Manifest for web application)
* does the app have associated service workers (indication that the
app might actually use the downloaded data for some offline
experience)
* how much space is left on device
* what kind of device: desktop with broadband or mobile with GPRS
etc.



>
> One solution I know that tries to deal with that is Linux's OOM killer:
> If you go over the quota, your program is likely to be eaten by a grue.
>
>>>
>>>> Native apps are not
>>>> controlled when it comes to storing data and nobody complains.
>>>
>>> Is there any documentation on how they handle the above scenario? Just
>>> write to disk until you hit failure?
>>
>> I think so. This is certainly the case with desktop apps. I also didn't
>> find any mention of quota in Android download manager docs
>> (http://developer.android.com/reference/android/app/DownloadManager.html) or
>> in Tizen's Download API
>> (https://developer.tizen.org/dev-guide/2.3.0/org.tizen.mobile.native.apireference/group__CAPI__WEB__DOWNLOAD__MODULE.html)
>>
>>
>> Regards,
>> --
>> Janusz Majnert
>> Senior Software Engineer
>> Samsung R&D Institute Poland
>> Samsung Electronics
>
> --
> Nils Dagsson Moskopp // erlehmann
> <http://dieweltistgarnichtso.net>
Received on Sunday, 15 March 2015 22:18:49 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:29 UTC