Re: How to implement gzip?

83 views
Skip to first unread message

Stephan Zuercher

unread,
Sep 11, 2018, 11:55:03 AM9/11/18
to wann...@gmail.com, envoy-dev
I've not used the gzip filter myself, but it definitely has to go after the router in the config.

On Tue, Sep 11, 2018 at 3:50 AM, <wann...@gmail.com> wrote:
"listener": {
  "name": "listner-http-443",
  "address": {
    "socketAddress": {
      "address": "0.0.0.0",
      "portValue": 443
    }
  },
  "filterChains": [
    {
      "filterChainMatch": {
        "sniDomains": [
          "*.abcxyz.com",
          "abcxyz.com"
        ]
      },
      "tlsContext": {
        "commonTlsContext": {
          "tlsCertificates": [
            {
              "certificateChain": {
                "filename": "/etc/envoy/cert.pem"
              },
              "privateKey": {
                "filename": "/etc/envoy/key.pem"
              }
            }
          ],
          "alpnProtocols": [
            "h2,http/1.1"
          ]
        }
      },
      "filters": [
        {
          "name": "envoy.http_connection_manager",
          "config": {
            "http_filters": [
              {
                "name": "envoy.router"
              },
              {
                "name": "envoy.gzip"
              }
            ],
            "rds": {
              "config_source": {
                "ads": {
                  
                }
              },
              "route_config_name": "my-routes"
            },
            "stat_prefix": "http"
          }
        }
      ]
    }
  ]
}

Above is my listener config for HTTPS. Envoy accepts is as normal. When I send a request with or without "Accept-Encoding : application/gzip", the response is always the same (no compression). Not sure what to make of it. Also is there any tool I can use to check if response is gzipped?

I used a simple python flask app with text/html response content type of approx 2.55MB text.
Headers I have tried
"Accept-Encoding : application/gzip"
"Accept-Encoding : gzip"
"accept-encoding : application/gzip"
"accept-encoding : *"
"accept-encoding : *;q=0,gzip;q=1"
and some other too.

The response headers (postman):
content-length →2670494
content-type →text/html; charset=utf-8
date →Tue, 11 Sep 2018 10:16:46 GMT
server →envoy
x-envoy-upstream-service-time →18

--
You received this message because you are subscribed to the Google Groups "envoy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to envoy-dev+unsubscribe@googlegroups.com.
To post to this group, send email to envo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-dev/1adf08a9-8749-4fb1-9a4a-8f1349fb88bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages