I want to send a compressed POST data with Javascript to a server I control. Is there any way to let the HTTP layer deal with the compression.
I\'m sending JSON. If
It's possible, but I would recommend strongly against accepting gzipped data incoming to your server. The main reason is to prevent your server from getting gzip bombed. It's generally not possible to know what the uncompressed data looks like before actually uncompressing it, so a user could send you a web request that looks like a harmless 1 KB or 1 MB of data but is really 100 GB of data, and then your web server (nginx or apache) hangs the next 10 minutes trying to decompress it all, eventually running out of memory/locking up.