> <span class="Apple-style-span" style="font-weight: bold; ">Maybe the local storage API needs a way to distinguish between cached data that can be silently thrown away, and important data that can't.</span><div><b><br>
</b></div><div><b><span class="Apple-style-span" style="font-weight: normal;">What if instead of the storage APIs providing a way to distinguish things, UA's provide a way for users to indicate which applications are "important", and UA's provide a way for applications guide a user towards making that indication.</span></b></div>
<div><br></div><div><b><span class="Apple-style-span" style="font-weight: normal;">Seems like permissioning, blessing, could happen out-of-band of the existing storage APIs.</span></b></div><div><b><span class="Apple-style-span" style="font-weight: normal; "><br>
</span></b><br><div class="gmail_quote">On Wed, Aug 26, 2009 at 4:51 PM, Jens Alfke <span dir="ltr"><<a href="mailto:snej@google.com">snej@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div class="im"><br><div><div>On Aug 26, 2009, at 4:01 PM, Linus Upson wrote:</div><br><blockquote type="cite"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Baskerville;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div>
The analogy was made comparing a user agent that purges local storage to an OS throwing out files without explicit user action. This is misleading since most files arrive on your computer's disk via explicit user action. You copy files to your disk by downloading them from the internet, copying from a network drive, from a floppy, your camera, etc.</div>
</span></blockquote><br></div></div><div>A web app would also be pretty likely to put stuff in local storage as a result of explicit user action. The use cases seem pretty similar.</div><div><br></div><div>Also, you're not counting files that you <i>create</i> locally. After all, files have to come from somewhere :) Those are the most precious since they're yours and they may not live anywhere else if you haven't backed them up or copied them elsewhere. There's no reason web-apps can't create the same kind of content, and it would look very similar to a user: I go to the word processor [website], click New Document, type some stuff, and click Save.</div>
<div><br></div><div>Even if the save process involves migrating the local data up to the cloud, that transition is not instantaneous: it can take arbitrarily large amounts of time if there are network/server problems or the user is offline. During that time, <i>the local storage represents the only copy of the data</i>. There is therefore a serious race condition where, if the browser decides to purge local data before the app has uploaded it, the data is gone forever.</div>
<div><br></div><div><div class="im"><blockquote type="cite"><div>A better analogy would be, "What if watching TV caused 0-5MB size files to silently be created from time to time in a hidden folder on your computer, and when your disk filled up both your TV and computer stopped working?"</div>
</blockquote><div><br></div></div><div>This is a cache — that isn't the kind of usage I'm concerned about. Maybe the local storage API needs a way to distinguish between cached data that can be silently thrown away, and important data that can't. (For example, the Mac OS has separate 'Caches' and 'Application Support' subfolders of ~/Library/.)</div>
<div><br></div><div>First, this is what quotas are for. The TV web-app would have a limited quota of space to cache stuff.</div><div>Second, the browser should definitely help you delete stuff like this if disk space does get low; I'm just saying it shouldn't delete it silently or as part of some misleading command like "Empty Cache" or "Delete Cookies".</div>
<div><br></div><div><div class="im"><blockquote type="cite"><div>At a minimum the HTML 5 spec should be silent on how user agents implement local storage policies. I would prefer the spec to make it clear that local storage is a cache, domains can use up to 5MB of space without interrupting the user, and that UAs were free to implement varying cache eviction algorithms.</div>
</blockquote><div><br></div></div><div>That will have the effect of making an interesting category of new applications fail, with user data loss, on some browsers. That sounds like a really bad idea to me.</div><div><br></div>
<div>To repeat what I said up above: <b>Maybe the local storage API needs a way to distinguish between cached data that can be silently thrown away, and important data that can't.</b></div><div><br></div><font color="#888888"><div>
—Jens</div></font></div></div></div></blockquote></div><br></div>