6 ms·
The problem here is that this could remove your ability to use localstorage in your application for anything but your JS source. We were hitting issues with som
by mikegioia 13y ago
The problem here is that this could remove your ability to use localstorage in your application for anything but your JS source. We were hitting issues with some browser's 2-3MB limit when storing data for offline use.
- eli 13y agoI believe it's at least 5MB on all major browsers (that support it).... but I think text is stored UTF-16, so that gets used up more quickly than you might expect.
- Fishkins 13y agoI've been using LZString for data I put in LocalStorage. Obviously you can still hit the limit, but it takes quite a bit longer. http://pieroxy.net/blog/pages/lz-string/index.html http://pieroxy.net/blog/pages/lz-string/index.html
- diurnalist 13y agoNice! Thanks for the link. I've opened an issue for us to track adding compression in and out of the cache here: https://github.com/diurnalist/dynosrc/issues/4 https://github.com/diurnalist/dynosrc/issues/4
- recuter 13y agoQuite a bit being basically twice as long. So you're up to localstorage being usable with 6-10MB now which is nothing to sneeze at.
- Fishkins 13y agoFor the data I was compressing (JSON) it was getting it to about 17% of the original size. Obviously that will vary depending on your data.
- diurnalist 13y agoHmm, good point. Given that we conceptualized and implemented the first iteration of this over a hackathon, I'm not surprised we missed some important things ;) I've added an issue to track allowing configuring how much cache to allow the JS storage to eat up: https://github.com/diurnalist/dynosrc/issues/5 https://github.com/diurnalist/dynosrc/issues/5
- recuter 13y agoI think people would appreciate if you elaborate on which browsers were problematic. I assume the old Android 'Browser' and iOS<6 as well as oldIE?