Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我配置了gzip,但是没有生效,是哪里写错了吗 #1756

Open
henkuaifacai opened this issue Feb 13, 2025 · 2 comments
Open

我配置了gzip,但是没有生效,是哪里写错了吗 #1756

henkuaifacai opened this issue Feb 13, 2025 · 2 comments

Comments

@henkuaifacai
Copy link

henkuaifacai commented Feb 13, 2025

这是配置,麻烦大佬们帮忙看看,还有可以对单个域名配置gzip吗
[root@k8s-3 higress-core]# kubectl get cm higress-config -n new-higress-system -o yaml

apiVersion: v1
data:
  higress: |-
    gzip:
      enable: true
      minContentLength: 1024
      contentType:
        - text/plain
        - text/html
        - application/json
        - text/css
        - application/javascript
        - application/xhtml+xml
        - image/svg+xml
      disableOnEtagHeader: true
      memoryLevel: 5
      windowBits: 12
      chunkSize: 4096
      compressionLevel: BEST_COMPRESSION
      compressionStrategy: DEFAULT_STRATEGY
    downstream:
      connectionBufferLimits: 32768
      http2:
        initialConnectionWindowSize: 1048576
        initialStreamWindowSize: 65535
        maxConcurrentStreams: 100
      idleTimeout: 180
      maxRequestHeadersKb: 60
      routeTimeout: 0
    upstream:
      connectionBufferLimits: 10485760
      idleTimeout: 10
@johnlanni
Copy link
Collaborator

你测试的时候,请求头里带 Accept-Encoding: gzip 了吗?

@henkuaifacai
Copy link
Author

你测试的时候,请求头里带 Accept-Encoding: gzip 了吗?

带了的
[root@master-01 ~]# curl -I -H "Accept-Encoding: gzip, deflate" http://*******:31644/test.txt
HTTP/1.1 200 OK
server: istio-envoy
date: Thu, 13 Feb 2025 12:26:42 GMT
content-type: text/plain
content-length: 172794
last-modified: Thu, 13 Feb 2025 06:26:47 GMT
etag: "67ad90a7-2a2fa"
accept-ranges: bytes
req-cost-time: 2
req-arrive-time: 1739449602537
resp-start-time: 1739449602539
x-envoy-upstream-service-time: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants