You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Leif Hedstrom (JIRA)" <ji...@apache.org> on 2016/11/01 14:22:58 UTC
[jira] [Commented] (TS-5024) Gzip plugin gzips multiple times
[ https://issues.apache.org/jira/browse/TS-5024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15625550#comment-15625550 ]
Leif Hedstrom commented on TS-5024:
-----------------------------------
There's an easy solution specific to the gzip plugin for this problem, which [~vmamidi] discovered comes from the fact that the HttpSM can be restarted (e.g. via escalate plugin). We can simply change the plugin to not run gzip on 404 responses :).
{code}
diff --git a/plugins/gzip/gzip.cc b/plugins/gzip/gzip.cc
index 51110b1..d6d7dd0 100644
--- a/plugins/gzip/gzip.cc
+++ b/plugins/gzip/gzip.cc
@@ -480,8 +480,8 @@ gzip_transformable(TSHttpTxn txnp, bool server, HostConfiguration *host_configur
resp_status = TSHttpHdrStatusGet(bufp, hdr_loc);
- // conservatively pick some statusses to compress
- if (!(resp_status == 200 || resp_status == 404 || resp_status == 500)) {
+ // conservatively pick some statusses to compress. ToDo: Make this configurable?
+ if (resp_status != 200) {
info("http response status [%d] is not compressible", resp_status);
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
return 0;
{code}
I think the "downside" here is very marginal, but curious if [~oschaaf] had some real reasons why it is important to gzip these error pages ?
> Gzip plugin gzips multiple times
> --------------------------------
>
> Key: TS-5024
> URL: https://issues.apache.org/jira/browse/TS-5024
> Project: Traffic Server
> Issue Type: Bug
> Components: Plugins
> Reporter: Meera Mosale Nataraja
> Assignee: Leif Hedstrom
>
> Gzip plugin gzips multiple times when you enable redirection by following settings or using escalate plugin.
> Enable redirection:
> CONFIG proxy.config.http.redirection_enabled INT 1
> CONFIG proxy.config.http.number_of_redirections INT 3
> Curl command output is provided below. Notice multiple "Content-Encoding: gzip" headers.
> curl -v -o/dev/null http://proxy-test:8080/get -H "Host: proxy-test" -x localhost:8080 -H "Accept-encoding: gzip"
> * About to connect() to proxy localhost port 8080 (#0)
> * Trying ::1... connected
> * Connected to localhost (::1) port 8080 (#0)
> > GET http://proxy-test:8080/get HTTP/1.1
> > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> > Accept: */*
> > Proxy-Connection: Keep-Alive
> > Host: proxy-test
> > Accept-encoding: gzip
> >
> % Total % Received % Xferd Average Speed Time Time Time Current
> Dload Upload Total Spent Left Speed
> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0< HTTP/1.1 404 Not Found
> < Server: ATS/7.1.0
> < X-Frame-Options: SAMEORIGIN
> < X-Xss-Protection: 1; mode=block
> < Accept-Ranges: bytes
> < X-Content-Type-Options: nosniff
> < Content-Type: text/html; charset=UTF-8
> < Cache-Control: max-age=300
> < Expires: Mon, 31 Oct 2016 18:29:44 GMT
> < Date: Mon, 31 Oct 2016 18:24:44 GMT
> < Content-Encoding: gzip
> < Vary: Accept-Encoding
> < Content-Encoding: gzip
> < Content-Encoding: gzip
> < Content-Length: 4456
> < Age: 0
> < Proxy-Connection: keep-alive
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)