Re:Eliminate HTTP requests using JavaScript diffs and LocalS...
by mikegioia on Tuesday November 12, 2013 @03:53PM
(#6720966)
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.
[ Parent
| on HN ]
Re:Eliminate HTTP requests using JavaScript diffs and LocalS...
by eli on Tuesday November 12, 2013 @03:57PM
(#6720997)
I 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.
Re:Eliminate HTTP requests using JavaScript diffs and LocalS...
by Fishkins on Tuesday November 12, 2013 @05:17PM
(#6721667)
I'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
Re:Eliminate HTTP requests using JavaScript diffs and LocalS...
by diurnalist on Tuesday November 12, 2013 @05:33PM
(#6721830)
Nice! 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
Re:Eliminate HTTP requests using JavaScript diffs and LocalS...
by recuter on Tuesday November 12, 2013 @05:53PM
(#6721965)
Quite 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.
Re:Eliminate HTTP requests using JavaScript diffs and LocalS...
by Fishkins on Tuesday November 12, 2013 @07:56PM
(#6722615)
For 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.
Re:Eliminate HTTP requests using JavaScript diffs and LocalS...
by recuter on Tuesday November 12, 2013 @05:55PM
(#6721974)
I 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?
Re:Eliminate HTTP requests using JavaScript diffs and LocalS...
by diurnalist on Tuesday November 12, 2013 @05:35PM
(#6721846)
Hmm, 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