I just make simple 'ajax' request to some html file. But i get compressed-gzipped data from server. How to decompress. Possible some header option via ajax to tell to the server we dont accept gzip deflate compression? Thanks. Xinstict
Or is there some 'ajax framework' which support gzip responses or have option to tell the server via header that we dont support gzip.
you don't actually need to worry about decompressing the ajax response, because that's done automatically by your browser. most probably the issue is not on the gzip / deflate compression not being decompressed by your browser (otherwise that'd mean your browser is not working properly). check the script that's called by your ajax. there may be something wrong there. FYI, this is what happens in regards to data compression in an http request (including ajax request): 1. When browser sends a request to the web server, it includes in its request header what compression method(s) it supports. 2. When sending a response back, web server decompresses the data with one of the compression methods specified by the browser, and includes in its response header information about what compression method it chose to use.* 3. Browser checks the response header what compression method (if any) was applied to the response data, and decompresses the data before rendering it or passing it to javascript / ajax. * Note regarding #2 above: the web server may decide not to decompress the http response if: a) it doesn't support any of the compression methods that the browser supports, or b) the file type being requested is one that the web server is configured not to compress. for example, binary files like images, flash, audio, video, etc are usually configured not to be compressed (otherwise it'd just be a waste of resources).