Can I compress data in JavaScript?

后端 未结 3 1876
死守一世寂寞
死守一世寂寞 2021-01-05 08:56

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 sending to the server?

And ho

相关标签:
3条回答
  • 2021-01-05 09:41

    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.

    0 讨论(0)
  • 2021-01-05 09:46

    Using LZW compression:

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

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

    0 讨论(0)
  • 2021-01-05 09:52

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

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

    0 讨论(0)
提交回复
热议问题