[whatwg] Web Storage: apparent contradiction in spec
snej at google.com
Tue Aug 25 15:09:34 PDT 2009
Interesting comments. Linus and Jeremy appear to be coming at this
from a pure "cloud" perspective, where any important or persistent
data is kept on a remote server and the browser, so local storage can
be treated as merely a cache. That's definitely a valid position, but
from my perspective, much of the impetus for having local storage is
to be able to support other application models, where important data
is stored locally. If browsers are free to dispose HTML5 local storage
without the user's informed consent, such applications become
For example, Linus wrote:
> User agents need to be free to garbage collect any local state. If
> they can't then attackers (or the merely lazy) will be able to fill
> up the user's disk. We can't expect web sites or users to do the
> chore of taking out the garbage.
Replace "user agent" -> "operating system" and "local state" -> "user
files", and you have an argument that, when the hard disk in my
MacBook gets too full, the OS should be free to start randomly
deleting my local files to make room. This would be a really bad idea.
Similar analogies —
• If the SD card in my Wii fills up, should the system automatically
start deleting saved games?
• If my iPhone's Flash disk gets full, should it start deleting
photos? What if I haven't synced those photos to my iTunes yet?
In each of those cases, what the device actually does is warns you
about the lack of free space, and lets you choose what to get rid of.
Local storage is different from cloud storage. The HTML5 storage API
can be used for both, so it shouldn't be limited to what's convenient
for just one of them.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the whatwg