3

I would like to be able to compress the data sent from a client to a django server. The data I need to compress is mainly binary, but some endpoints receive also large jsons with binary data encoded to base64.

I've found lots of info regarding the opposite way (server returning compressed response) for example https://docs.djangoproject.com/en/1.2/ref/middleware/#module-django.middleware.gzip, however this is not what I need.

What I'm basically asking is:

  1. Is there a standard/recommended way for compressing client requests? gzip, LZW, Huffman...

  2. How do I support this in Django?

odedfos
  • 4,491
  • 3
  • 30
  • 42

1 Answers1

0

Responses:

1 - You could compress the data on the client and then send it to the server. I've seen Javascript libraries to compress to ZIP. The data can be uncompressed on the server.

2 - Uncompress the request parameter using Python zip library.

jordiburgos
  • 5,964
  • 4
  • 46
  • 80