4 ms·
Any kind of DOM storage (cookies, localStorage, IndexedDB, etc.) is ephemeral. The browser needs to decide the maximum amount of disk space that it wants to con
by briansmith 14y ago
Any kind of DOM storage (cookies, localStorage, IndexedDB, etc.) is ephemeral. The browser needs to decide the maximum amount of disk space that it wants to consume, and then when it hits that limit, it needs to start throwing away (garbage collecting) some of the data based on some policy like LRU.
If the web app really needs permanent storage then that permanence of storage needs to be granted explicitly by the user.
- Tichy 14y agoI think localStorage already asks the user.
- daleharvey 14y agoit doesnt, indexeddb and filesystem api do though
- espadrine 14y agoArguably, that's the spirit of the FileSystem API. http://www.w3.org/TR/file-system-api/ http://www.w3.org/TR/file-system-api/ > An application can request temporary or persistent storage space. Temporary storage may be easier to get, at the UA's discretion [looser quota restrictions, available without prompting the user], but the data stored there may be deleted at the UA's convenience, e.g. to deal with a shortage of disk space. > Conversely, once persistent storage has been granted, data stored there by the application should not be deleted by the UA without user intervention. The application may of course delete it at will. The UA should require permission from the user before granting persistent storage space to the application.
- Sami_Lehtinen 14y agoThere are better options than LRU which gets too easily flushed. Check out CLOCK-Pro and LIRS.