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?
Try this: http://rosettacode.org/wiki/LZW_compression#JavaScript
Maybe this one? http://jszip.stuartk.co.uk/
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With