Easy HTTP requests with gzip/deflate compression

For anyone coming across this in recent times, the request library supports gzip decompression out of the box now. Use as follows: request( { method: ‘GET’ , uri: ‘http://www.google.com’ , gzip: true } , function (error, response, body) { // body is the decompressed response body console.log(‘server encoded the data as: ‘ + (response.headers[‘content-encoding’] || … Read more

Why are major web sites using gzip?

It is apparently due to a misunderstanding resulting from the choice of the name “Deflate”. The http standard clearly states that “deflate” really means the zlib format: The “zlib” format defined in RFC 1950 [31] in combination with the “deflate” compression mechanism described in RFC 1951 [29]. However early Microsoft servers would incorrectly deliver raw … Read more

Deflate compression browser compatibility and advantages over GZIP

UPDATE: Browsers have been dropping support for raw deflate. zOompf has completed some very thorough research on this very topic here. Unfortunately, it appears that raw deflate is NOT safe to use. Check http://www.vervestudios.co/projects/compression-tests/results for more results. Here are the browsers that have been tested: /* Browser DEFLATE ZLIB */ XP Internet Explorer 6 PASS … Read more

Why use deflate instead of gzip for text files served by Apache?

Why use deflate instead of gzip for text files served by Apache? The simple answer is don’t. RFC 2616 defines deflate as: deflate The “zlib” format defined in RFC 1950 in combination with the “deflate” compression mechanism described in RFC 1951 The zlib format is defined in RFC 1950 as : 0 1 +—+—+ |CMF|FLG| … Read more

tech