When retrieving data from the server through HTTP, you can generally rely on your web server to compress the information using gzip or deflate. You can even do the trick yourself on your backend code. However, sending large amounts of data from the browser -to- the server, is another story.
I’ve written a .NET version which is an almost-literal translation of that decompression algorithm. You can find it on my github. It was successfully tested on the .Net framework 3.5, 4.0, and it also works on Mono.
Compressing and decompressing data is processor-hungry, beware that for certain small-sized chunks of data, as well as for data with a high level of entropy, it can be actually slower than sending the original uncompressed string.
Use the demo and paste some of your real data to see the effect. Note that LZW is very good at compressing repetitive text. Serialized data, specially collections, tend to contain repeated key names, repeated values, etc.
Content under Attribution-Share Alike 3.0 Unported