Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to send compressed post data using jquery?

I am quite sure this question might sound silly but I am just curious to know if it is possible to compress data before sending it through jQuery post. I was looking for jQuery plugins that have compression algorithm but couldn't really find anything relevant. I am aware that Javascript should no really be used for compression because it is slow but what does one do if the outgoing post involves large amount of data? Any suggestions?

like image 233
Legend Avatar asked Feb 20 '11 21:02

Legend


3 Answers

Try this: http://rosettacode.org/wiki/LZW_compression#JavaScript

like image 105
Mārtiņš Briedis Avatar answered Nov 04 '22 23:11

Mārtiņš Briedis


Maybe this one? http://jszip.stuartk.co.uk/

like image 34
Codler Avatar answered Nov 05 '22 01:11

Codler


lz-string

I've used this in production and had no issues. First compress client-side, then decompress on server. Especially useful if your server is Node, so you can use the exact same code to ensure compatibility.

like image 1
Eirik Birkeland Avatar answered Nov 04 '22 23:11

Eirik Birkeland