1
| <script src="https://cdn.bootcss.com/lz-string/1.4.4/base64-string.js"></script>
|
1 2 3 4 5 6 7 8 9 10 11
| var jsonobj = {'sample': 'This is supposed to be ling string', 'score': 'another long string which is going to be compressed'}
localStorage.setItem('mystring', LZString.compress(JSON.stringify(jsonobj)));
var string = LZString.decompress(localStorage.getItem('mystring'))
JSON.parse(string);
|
https://stackoverflow.com/questions/20773945/storing-compressed-json-data-in-local-storage
https://stackoverflow.com/questions/294297/javascript-implementation-of-gzip