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
Conditional compression based on request Content-Type #5721
Conditional compression based on request Content-Type #5721
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not work on my test:
I got the following error message multiple times
mime: no media type" middlewareName=jenkins-compress@docker middlewareType=Compress
For reproduction: I used the following example:
version: '3'
services:
proxy:
# Built with "make build-image"
# from https://github.com/containous/traefik/pull/5721/commits/d6a2d32b5c306141312811dac74d5a9da5a53c61
image: 76025322bc49
command:
- --providers.docker
- --entrypoints.web.address=:80
- --api.insecure=true
ports:
- "80:80"
- "8080:8080"
labels:
- traefik.enable=false
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
cloudbees-jenkins:
image: cloudbees/jenkins-enterprise:latest
restart: unless-stopped
labels:
- traefik.http.routers.jenkins.rule=Host(`jenkins.localhost`)
- traefik.http.services.jenkins.loadbalancer.server.port=8080
- traefik.http.middlewares.jenkins-compress.compress=true
- traefik.http.middlewares.jenkins-compress.compress.excludedcontenttypes=application/javascript
- traefik.http.routers.jenkins.middlewares=jenkins-compress
I expect any requests to application/json
file to NOT be compressed ,
but it is still gzipped:
Di I do something wrong?
|
After an exchange:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
b957668
to
a09be6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
a09be6c
to
d29a4e1
Compare
What does this PR do?
Allow to exclude some Content-Type of the compression.
Motivation
Fixes #2576
Closes #5120
More