4 ms·
Local Storage And How To Use It On Websites
- shawndumas 16y agoRemy Sharp's Storage pollyfiller[1]. (What's a pollyfill? Good question[2]!) ----- [1]: http://gist.github.com/350433 http://gist.github.com/350433 [2]: http://remysharp.com/2010/10/08/what-is-a-polyfill/ http://remysharp.com/2010/10/08/what-is-a-polyfill/
- sant0sk1 16y agoMy biggest beef with local storage is the seemingly arbitrary 5MB storage limit. I understand that you have to set a limit somewhere, but why so little? I've already hit this limit when trying to do long-term caching of server-side data in one web app. It's 2010, why can't we have 100MB of storage per domain?
- kingofspain 16y agoWell it's a step up from 4K :) I'm not sure I'd especially like each site I visit to possibly use 100MB of my storage (storage may be cheap, but so am I!), but I wouldn't see the problem in having some kind of dialog asking permission to use xMB if it's over 5. I realise that adds another layer of complication and may "frighten your gran".
- pavel_lishin 16y agoSeems like it should be a browser setting. 5mb sounds entirely reasonable as a default value.
- sant0sk1 16y agoIt is on some browsers (FireFox I think) and not on others. This would be fine with me if that was outlined in the spec, but these gray areas always produce 3-4 different implementations.
- sant0sk1 16y agoI'd be cool with that too if all the browsers implemented it. Sadly they do not :(
- jmreid 16y agoI believe the browser does ask if you want to go over the limit. At least Safari's setting suggests that: http://imgur.com/wfMDA.png http://imgur.com/wfMDA.png
- pavel_lishin 16y ago> Because cookies have been used to spy on people’s surfing behavior, security-conscious people and companies turn them off or request to be asked every time whether a cookie should be set. Won't local storage run into this very same problem rather quickly?
- JustinSeriously 16y agoGood point. For Firefox users, browse to "about:config", then search for "dom.storage.enabled".
- samdk 16y agoDive Into HTML5 has another good overview of using Local Storage, along with ways to fall back on other methods if it's not supported and some information about (potential) replacements: http://diveintohtml5.org/storage.html http://diveintohtml5.org/storage.html
- clyfe 16y agohttp://github.com/benpickles/js-model http://github.com/benpickles/js-model A JS ORM that can use localStorage as ... storage.
- DTrejo 16y agoStore.js - cross browser local storage without using cookies or flash (supports even IE6 OMG!) http://news.ycombinator.com/item?id=1468802 http://news.ycombinator.com/item?id=1468802