开发者

Can I compress data in JavaScript?

开发者 https://www.devze.com 2023-03-08 13:33 出处:网络
I\'m using some pretty heavy AJAX with lots of data going from client to server. How can I compress the data (mostly plain text) before sendi开发者_如何学编程ng to the server?

I'm using some pretty heavy AJAX with lots of data going from client to server. How can I compress the data (mostly plain text) before sendi开发者_如何学编程ng to the server?

And how can I uncompress the data on the server side?


jSEND seems to do EXACTLY this. Anyone ever use it?

Broken link removed: led to spam landing page @ jsend.org


The jsolait library has a codec that supports the LZW algorithm (among others, including base64 encoding/decoding). The only thing that makes me a little hesitant is that this library is no longer being actively maintained.

EDIT

I was able to find a few more implementations of the LZW algorithm in Javascript.


Using LZW compression:

client site: http://jsfiddle.net/sebastienp/p7kDe/

server site: http://webdevwonders.com/lzw-compression-and-decompression-with-javascript-and-php/

0

精彩评论

暂无评论...
验证码 换一张
取 消