You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by GitBox <gi...@apache.org> on 2020/06/04 17:48:53 UTC
[GitHub] [trafficserver] ezelkow1 opened a new issue #6852: Compress plugin can return 2 Content-Encoding fields
ezelkow1 opened a new issue #6852:
URL: https://github.com/apache/trafficserver/issues/6852
`url http://localhost:8080/test.txt -Lvsk -H "Accept-Encoding: br,deflate,gzip" -o /dev/null
* Trying ::1:8080...
* Connected to localhost (::1) port 8080 (#0)
> GET /test.txt HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.69.1
> Accept: */*
> Accept-Encoding: br,deflate,gzip
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Vary: Accept-Encoding
< Content-Encoding: gzip
< Last-Modified: Thu, 04 Jun 2020 17:36:45 GMT
< Content-Type: text/plain
< Accept-Ranges: bytes
< Date: Thu, 04 Jun 2020 17:39:40 GMT
< Server: ATS/10.0.0
< Etag: "1311141015-df"
< Cache-Control: public
< Content-Encoding: br
< Content-Length: 1048929
< Age: 0
< Connection: keep-alive
<
{ [43434 bytes data]`
This was using lighttpd as a test origin. I had already requested this content previously
This is the cached alternate that ATS found:
`[alts] ---- alternate #1 (Q = 1.003) has these request/response hdrs:
GET http://localhost:80/test.txt HTTP/1.1
Host: localhost:80
User-Agent: curl/7.69.1
Accept: */*
Accept-Encoding: br, gzip
Client-ip: ::1
X-Forwarded-For: ::1
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Encoding: gzip
Last-Modified: Thu, 04 Jun 2020 17:36:45 GMT
ETag: "1311141015"
Content-Type: text/plain
Accept-Ranges: bytes
Expires: Thu, 04 Jun 2020 17:39:01 GMT
Cache-Control: max-age=60
Cache-Control: public
Content-Length: 1048900
Date: Thu, 04 Jun 2020 17:38:01 GMT
Server: lighttpd/1.4.54`
Then determined it needed to reval due to age:
[Jun 4 17:39:40.499] [ET_NET 15] DEBUG: <HttpTransact.cc:2810 (HandleCacheOpenReadHit)> (http_trans) [2] CacheOpenRead --- send_revalidate = 1
[Jun 4 17:39:40.499] [ET_NET 15] DEBUG: <HttpTransact.cc:2813 (HandleCacheOpenReadHit)> (http_trans) [2] CacheOpenRead --- HIT-STALE
and created this request for reval
`+++++++++ Proxy's Request after hooks +++++++++
-- State Machine Id: 2
GET /test.txt HTTP/1.1
Host: localhost:80
User-Agent: curl/7.69.1
Accept: */*
Accept-Encoding: br, gzip
Client-ip: ::1
X-Forwarded-For: ::1
Via: http/1.1 traffic_server[0db34ec6-fedc-4d40-8aec-b82cdaf0c879] (ApacheTrafficServer/10.0.0)
If-Modified-Since: Thu, 04 Jun 2020 17:36:45 GMT
If-None-Match: "1311141015"
`
Apparently lighttpd does not return an encoding for 304 requests, or at least it doesnt the way I have it configured, so compress just saw the responses content-type:
[Jun 4 17:39:40.500] [ET_NET 15] DIAG: (compress) INFO: reading response headers
[Jun 4 17:39:40.500] [ET_NET 15] DIAG: (compress) INFO: compressible content type [text/plain], matched on pattern [text/*]
[Jun 4 17:39:40.500] [ET_NET 15] DIAG: (compress) DEBUG: [compress/compress.cc:774] [compress_transform_add] TransformedRespCache not enabled
[Jun 4 17:39:40.500] [ET_NET 15] DIAG: (compress) DEBUG: [compress/compress.cc:116] [data_alloc] brotli compression. Create Brotli Encoder Instance.
`+++++++++ Incoming O.S. Response +++++++++
-- State Machine Id: 2
HTTP/1.1 304 Not Modified
Vary: Accept-Encoding
Content-Type: text/plain
Last-Modified: Thu, 04 Jun 2020 17:36:45 GMT
ETag: "1311141015"
Cache-Control: public
Date: Thu, 04 Jun 2020 17:39:40 GMT
Server: lighttpd/1.4.54
`
However ATS still had the origin unmodified header:
`+++++++++ Header To Transform +++++++++
-- State Machine Id: 2
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Encoding: gzip
Last-Modified: Thu, 04 Jun 2020 17:36:45 GMT
Content-Type: text/plain
Accept-Ranges: bytes
Date: Thu, 04 Jun 2020 17:39:40 GMT
Server: lighttpd/1.4.54
Etag: "1311141015"
Cache-Control: public
`
and then proceeded to do a brotli compress anyway:
[Jun 4 17:39:40.508] [ET_NET 15] DIAG: (compress) DEBUG: [compress/compress.cc:502] [brotli_transform_finish] brotli-transform: Finished brotli
[Jun 4 17:39:40.508] [ET_NET 15] DIAG: (compress) INFO: Compressed size 1048929 (bytes), Original size 1048900, ratio: -0.000028
[Jun 4 17:39:40.508] [ET_NET 15] DIAG: (compress) DEBUG: [compress/compress.cc:513] [compress_transform_finish] compress_transform_finish: brotli compression finish
at which point it then tacked on another Content-Encoding field:
`+++++++++ Header From Transform +++++++++
-- State Machine Id: 2
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Encoding: gzip
Last-Modified: Thu, 04 Jun 2020 17:36:45 GMT
Content-Type: text/plain
Accept-Ranges: bytes
Date: Thu, 04 Jun 2020 17:39:40 GMT
Server: lighttpd/1.4.54
Etag: "1311141015-df"
Cache-Control: public
Content-Encoding: br
Content-Length: 1048929
`
and sent that to the client:
`
+++++++++ Proxy's Response 2 +++++++++
-- State Machine Id: 2
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Encoding: gzip
Last-Modified: Thu, 04 Jun 2020 17:36:45 GMT
Content-Type: text/plain
Accept-Ranges: bytes
Date: Thu, 04 Jun 2020 17:39:40 GMT
Server: ATS/10.0.0
Etag: "1311141015-df"
Cache-Control: public
Content-Encoding: br
Content-Length: 1048929
Age: 0
Connection: keep-alive
`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] ezelkow1 edited a comment on issue #6852: Compress plugin can double compress on 304s without content-encoding
Posted by GitBox <gi...@apache.org>.
ezelkow1 edited a comment on issue #6852:
URL: https://github.com/apache/trafficserver/issues/6852#issuecomment-639018950
I can see how this is technically legally, but just seemed like a bug to me since in general compress appears to avoid double compression when possible. Also when the client said it accepted the original format it was encoded in stored in the cache, seems like extra work
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] ezelkow1 closed issue #6852: Compress plugin can double compress on 304s without content-encoding
Posted by GitBox <gi...@apache.org>.
ezelkow1 closed issue #6852:
URL: https://github.com/apache/trafficserver/issues/6852
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] ezelkow1 commented on issue #6852: Compress plugin can double compress on 304s without content-encoding
Posted by GitBox <gi...@apache.org>.
ezelkow1 commented on issue #6852:
URL: https://github.com/apache/trafficserver/issues/6852#issuecomment-639018950
I can see how this is technically legally, but just seemed like a bug to me since in general compress appears to avoid double compression when possible
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org