2 Replies Latest reply on Jan 8, 2008 8:40 AM by maxrahder

    HTTPService Accept-Encoding

      Newbie question: Can HTTPService accept compressed data? I imagine there are many designs, like mine, that send large XML results to the Flex client. Compressing this data would improve performance.

      One can set up one's HTTP server to send compressed data if the client -- Flex in this case -- can handle it. The client signals this ability by setting the "Accept-Encoding" request header to whatever compression method the client understands. I see that HTTPService has a "headers" property, but I don't see how to intervene as the data is received in order to de-compress it. Ideally, I hope there's an ActionScript de-compression class I can somehow attach to the HTTPService. This would make the de-compression transparent to my code.

      If HTTPService can accept compressed data, could someone post a code snippet -- or at least some advice -- showing how to do it?

      If HTTPService cannot accept compressed data, then someone on the development team should look into adding this capability. With so many published compression algorithms out there, implementation should be pretty easy. (Which is easy for me to say -- I'm not the one who'd write the routine! )
        • 1. Re: HTTPService Accept-Encoding
          Level 1
          Hi, you don't have to care about decompression because flash is doing it for you.

          If the server send content encoded in gzip for example, flash (or the browser ???) will decode it for you and will return you the data uncompressed. That's all.
          • 2. Re: HTTPService Accept-Encoding
            maxrahder Level 1
            I haven't had a change to explore this very much, but the one test I did try was to look at the headers being sent to the server. (I.e., I wrote a servlet to display the request headers.) There was no Accept-Encoding sent from Flex. Therefore, the server would not know it should send an encoded response. So even if Flex can handle it, the server wouldn't know it should use the encoding. Which brings me back to my original question: how can I have the header included in my requests from Flex? Thanks!