does casablanca support compression on http response?

May 29, 2014 at 9:58 AM

I'm wondering any compression will be applied to the http response, for example when the response is very big in size.

If it does, do i need to config it somewhere?

Jun 2, 2014 at 10:27 PM
Hi subuliu

Casablanca does not apply any compression to the http response data.

Jun 4, 2014 at 12:46 PM
thanks for your replay, kavyako,

So does the casablanca team has a plan for compression? what if my rest request is large in size? is there any ways to optimize?

thank you
Jun 12, 2014 at 2:15 AM
Hi subuliu

We do not have any plans to add support for compression/decompression.
On Windows Desktop, we build our http_client on top of WinHTTP. WinHTTP does not provide decompression support.

Are you looking at dealing with large data in the http_request or the http_response? I am assuming you are referring to the http_client. Let me know if I am wrong (if you are talking about the http_listener).

Jun 27, 2014 at 4:10 AM
hi kavyako,

sorry for replying late, it's been a busy month:(

i was referring to using http_client, and i might have large data in http_response.

The workaround i can think of now is:
  • Server side: compress my response data(with gzip, for example) and encode it to readable character with base64, so that it can fit into a http_response.
  • Client side: extract the data from http_response, decode with base64, and decompress the data
do you have any other workarounds?

Jun 28, 2014 at 12:04 AM
Hi subuliu

If you have control on the server implementation, you can also send the data in chunks or use chunked transfer encoding.
Refer to the http_client and http_listener tests at response_stream_tests.cpp, request_stream_tests.cpp in our test collateral.