Answer the question
In order to leave comments, you need to log in
Serializing a large array of numbers with compression?
Good day, dear habravchane!
Again, out of desperation, I turn to the community.
web application. It is necessary to transfer a fairly large array of numbers from the server to the browser. The array itself is different for each session, and is formed on the server side.
Keeping an array for each session on the server side, and loading the values as needed, would be expensive for memory on the server. In addition, you do not want to unnecessarily send cookies to the browser. Therefore, it was decided to transfer the array immediately with the page, so that the browser would process its data.
The serialized array in json takes about 85kb. But this is just with test data. It is necessary on the server to somehow compress the array of numbers into some string. And on the client side, unpack this line.
The server side is written in nodejs. Therefore, any compression / decompression algorithm in javascript will do.
Has anyone seen something similar on the net or faced similar problems?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question