Compress json output

Dear Friends,

I request apologizes about my bad English.

I'm working with the rest api of the arduino yun to put and read data from the "arduino side", and I wonder if it would be possible to configure arduino yun webserver to serve the json compressed.

Anybody knows how?

Thank you in advance.

R. Campos.

[quote author=Roque Campos link=topic=214140.msg1567785#msg1567785 date=1391015382]
I'm working with the rest api of the arduino yun to put and read data from the "arduino side", and I wonder if it would be possible to configure arduino yun webserver to serve the json compressed.[/quote]Well, let's start by you being more specific about what you mean by "compressed"...

Do you mean like in using zip/gzip comrepession or by eliminating repeating field descriptions as for example suggested here?

Ralf

Thank you for your attention.

I will try to explain it with an example. When I output a json object using php on the linino side, I can use the following:

function send_output($output)
{
    if (function_exists('ob_gzhandler')) ob_start('ob_gzhandler');
    else ob_start();
    echo $output;
    ob_end_flush();

}

Then I can send very big Json object to my clients, compressed with gzip (previous to this, you must enable the zlib compresion in php.ini).

And now I wonder if there is a way to compress the output of the json objects generated by the bridge library...

Hope my question is clearer now :sweat_smile:

Best regards