Incorrect example of blocking IE for deflate encoding

Michael Lenaghan michaell at dazzit.com
Mon Dec 20 22:07:30 CET 2010


The page at http://www.varnish-cache.org/trac/wiki/FAQ/Compression has
this example:

    if (req.http.Accept-Encoding) {
        if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {
            # No point in compressing these
            remove req.http.Accept-Encoding;
        } elsif (req.http.Accept-Encoding ~ "gzip") {
            set req.http.Accept-Encoding = "gzip";
        } elsif (req.http.Accept-Encoding ~ "deflate" &&
req.http.user-agent !~ "Internet Explorer") {
            set req.http.Accept-Encoding = "deflate";
        } else {
            # unkown algorithm
            remove req.http.Accept-Encoding;
        }
    }

According to the list of user agent strings at
http://www.useragentstring.com/pages/Internet%20Explorer/ IE never
uses the value "Internet Explorer"; rather, it uses "MSIE".



More information about the varnish-misc mailing list