Yii framework dealing with compressed requests
I am pretty new to the Yii framework, and I needs some help with dealing with compression. I followed this link http://www.yiiframework.com/wiki/39/, which works like a charm! Now my server is compressing everything in the responses.
However, I am also sending images from my client (iPhone) to the server through a POST. I am also compressing the data to the server. However, when I tu开发者_运维百科rn on the compression on the client side, things start to fall apart. The server sees the POST call, however, it does not see any of the parameters of the call. I think it is due to not understanding the compression.
I look at the traffic on a proxy, and the POST looks fine, and the data is also as expected.
What do I need to do to enable the server to be able to deal with the POST message with compression on?
Cheers, Yenyi
Compressing image POST uploads is not very efficient. The largest part (99%+) of the request is image data which is already compressed. Adding extra compression will save you maybe a few bytes and it will cost a lot of resources to implement. Compression is a CPU intensive task, so it will also drain the battery of the iPhone.
Client side compression for HTTP requests is rare and most web servers don't support it out of the box.
Read this question regarding server side gzip compression: Compressing content with PHP ob_start() vs Apache Deflate/Gzip?
精彩评论