Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deflate compression browser compatibility and advantages over GZIP

People also ask

What is the difference between gzip and DEFLATE?

gzip is based on the DEFLATE algorithm, which is a combination of LZ77 and Huffman coding. DEFLATE was intended as a replacement for LZW and other patent-encumbered data compression algorithms which, at the time, limited the usability of compress and other popular archivers.

Do any browsers not support gzip?

All modern browsers can handle a gzip encoded response. In fact, if you look at their requests, they'll have a header that says something along the lines of Accept-Encoding: gzip which is their way of saying to the server that they can handle gzipped responses.

What does gzip DEFLATE mean?

It means the client can accept a response which has been compressed using the DEFLATE algorithm.


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         FAIL
    XP Internet Explorer 7        PASS         FAIL
    XP Internet Explorer 8        PASS         FAIL
    Vista Internet Explorer 8     PASS         FAIL
    XP Firefox 3.6.*              PASS         PASS
    XP Firefox 3.5.3              PASS         PASS
    XP Firefox 3.0.14             PASS         PASS
    Win 7 Firefox 3.6.*           PASS         PASS
    Vista Firefox 3.6.*           PASS         PASS
    Vista Firefox 3.5.3           PASS         PASS
    XP Safari 3                   PASS         PASS
    XP Safari 4                   PASS         PASS     
    XP Chrome 3.0.195.27          PASS         PASS
    XP Opera 9                    PASS         PASS
    XP Opera 10                   PASS         PASS
    XP Sea Monkey 1.1.8           PASS         PASS
    Android 1.6 Browser (v4)*     N/A          N/A
    OS-X Safari 4                 PASS         PASS
    OS X Chrome 7.0.517.44        PASS         PASS
    OS X Opera 10.63              PASS         PASS
    iPhone 3.1 Safari             PASS         PASS

* Android Sends HTTP request header "Accept-Encoding: gzip". Deflate is not permitted.


I conclude that we can always send raw DEFLATE (when the HTTP request header "Accept-Encoding" contains "deflate") and the browser will be able to correctly interpret the encoded data. Can someone prove this wrong?

note: .NET's native implementation of DEFLATE (System.IO.Compression.DeflateStream) is raw DEFLATE. It also sucks. Please use zlib.net for all of your .NET deflating needs.


The Android 1.6 browser (v4) fails both the zlib and the deflate test on your page. I've added it to your list.


Isn't it the case that AddOutputFilterByType DEFLATE using mod_deflate sends by gzip by default?