I’ve got some strings that I need to compress server-side in C#, then decompress client-side in JavaScript. What can I use to accomplish this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming you’re fetching this data over HTTP, is there any reason you can’t do this at the HTTP level? (See this article for information about HTTP compression.)
That way you shouldn’t need to do anything on the client side, apart from making sure that the request includes the appropriate
Accept-Encodingheader. Depending on your server, you may be able to just tweak some server settings to get the compression automatically on that side too…To be honest, it’s worth breaking out WireShark to check exactly what’s going up and down the wire already. It’s just possible you’ve already got compression without knowing it 🙂