5 ms·
The quota for localStorage varies from 2MB to well, very high, depending on the browser. The average is around 5MB. There's a page here that shows results for v
by pamelafox 15y ago
The quota for localStorage varies from 2MB to well, very high, depending on the browser. The average is around 5MB. There's a page here that shows results for various browsers: http://dev-test.nemikor.com/web-storage/support-test/ http://dev-test.nemikor.com/web-storage/support-test/
It's not advisable to use it for a lot of data, especially if you actually need that data to stay around - it's better in situations where it's okay if the data goes away. You also need to be ready to handle over quota errors - e.g. in my lscache library, we kick out old data when that happens.
I talked about that in a localStorage talk recently (http://client-side-storage.appspot.com/ http://client-side-storage.appspot.com/ - click "show notes").
You might want to use the Lawnchair library, as that can be used with both localStorage and IndexedDB, which can theoretically handle a lot more data with better performance.
- unoti 15y agoThanks for sharing this! lscache is super cool. I also just watched and thoroughly enjoyed your Google IO talk on shyness work-arounds (http://www.youtube.com/watch?v=52Ml_zax4A0&t=24m9s http://www.youtube.com/watch?v=52Ml_zax4A0&t=24m9s). Great stuff all around.