Repository navigation
examples: add gzip - #16440
examples: add gzip#16440
Conversation
|
@daixiang0 first pass this looks good - thanks im wondering if we could do this without reference to stats as its somewhat confusing - preferably just use a more generic backend |
|
How about using nginx? |
its an option i guess - but probably not the one i would choose |
|
off the top of my head - how about a flask container that serves a 100MB file of zeros |
|
Not familiar with flask, would try it later. |
|
i guess what would be helpful here is to have 2 indentical files with different content types - one should be served compressed and the other not |
|
It depends on request compressed or not, different file types would make confuse I think. |
i dont think so - sure it depends on the accept header - but it also depends on what the server is willing to compress (see #16450 for the kind of problem that this might disambiguate) |
|
How about config different compressed support type, if not config Also, stats compressed is a common case I think. |
iiuc then yep that is the idea - one file that is compressed and one that is not
ok, lets keep the stats, but i think its important to show envoy proxying from an upstream with compression |
|
@phlax please review. |
1805d21 to
50b7c4d
Compare
|
@daixiang0 ive done a first review - looking great - it will probably take a few iterations, but this work is really appreciated |
|
another thing im wondering is whether we should demonstrate decompression |
Signed-off-by: Long Dai <[email protected]>
Signed-off-by: Long Dai <[email protected]>
Signed-off-by: Long Dai <[email protected]>
Signed-off-by: Long Dai <[email protected]>
Signed-off-by: Long Dai <[email protected]>
|
hmm, ok, this works: $ curl -si -H "Accept-Encoding: gzip" http://localhost:8089/file.json
HTTP/1.1 200 OK
content-disposition: inline; filename=file.json
content-type: application/json
last-modified: Mon, 17 May 2021 09:53:27 GMT
cache-control: no-cache
date: Mon, 17 May 2021 12:00:54 GMT
server: envoy
x-envoy-upstream-service-time: 3
content-encoding: gzip
vary: Accept-Encoding
transfer-encoding: chunked |
|
im completely baffled as to why responds_with_header \
"content-encoding: gzip" \
http://localhost:8089/file.json \
-si -H "Accept-Encoding: gzip"
|
you need to make the file world-readable - see other examples the reason for this is that some devs have strict umask settings (ie only user/group readable) so the tests mimick that environment |
|
@phlax Hi, could it merged? |
this is going to take a couple more iterations i think i will do a full review shortly as said - this PR is really appreciated and will be a very welcome addition - but i think it will take a bit more work first |
phlax
left a comment
There was a problem hiding this comment.
thanks @daixiang0 we are definitely getting there - altho i think a little way to go
i have mostly focused on the docs in this review - next round - once docs are ready - i will look more at the verify.sh script as this needs to match the docs as closely as possible
|
@phlax wait for your review :) |
phlax
left a comment
There was a problem hiding this comment.
thanks @daixiang0
hopefully this will be the last iteration - lets see...
a69728a to
bc48af1
Compare
|
@daixiang0 can you fix the trailing whitespace issue - you probably want to fix your editor to prevent this |
phlax
left a comment
There was a problem hiding this comment.
@daixiang0 a couple of minor nits - once they are fixed should be gtm
|
@phlax I fix one about trailing whitespace issue, and do not find more. If miss, please tell me. |
|
Great example! Thanks! Another example could be made for brotli compression. |
that would definitely be helpful - it will require tls in the mix as well i think @daixiang0 is that something you could take on ? |
|
I can take it later :) |
|
cool - added a ticket for it here #16747 |
Signed-off-by: Long Dai <[email protected]>
Signed-off-by: Long Dai [email protected]
For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md
Commit Message: Add gzip example.
Additional Description:
Some discuess in slack.
Risk Level: Low
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]