GZIP encoding in Adobe AIR/Flex - HOWTO
This means that response packet is compressed by Apache web server and your client will need to decompress it. Fortunately, both Flex and AIR 1.5.1 natively support GZIP compression. However there are a couple of things you need to watch out for.
Firstly, you need to enable Apache Module mod_deflate in your virtual host.
In your AIR application, you need to tell HTTPService component to accept gzip encoding and AIR will take care of the rest:
this.service.headers = {'Accept-Encoding':'gzip'};
If you are in a Flex project, specifying gzip encoding will throw the following error:
This is because Flex apps run in a browser and the browser is responsible for determining encoding type and decompression (if required). Therefore, you cannot specify encoding type in Flex apps.
Our problem is that we use one core library for AIR and Flex applications. So the issue above can be avoided by conditionally specifying encoding type depending on the framework used. This can be done in 2 lines of code:
this.service.headers = {'Accept-Encoding':'gzip'};
Note: this is not the complete solution - check out this entry for the rest of it :-)
Cheers Marko

