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/08/10 23:54:37 UTC

[GitHub] [trafficserver] bryancall opened a new issue #7099: ATS will send image/webp content to browsers that don't support it

bryancall opened a new issue #7099:
URL: https://github.com/apache/trafficserver/issues/7099


   If a browser that support webp makes a requests through ATS and the origin responds with Content-Type: image/webp that is cacheable ATS will cache the content.  If a browser that doesn't support webp, like Safari, then makes a request ATS will serve back the image/webp response.  This is because browser's send image/* and */* in their Accept: header.
   
   Request from Safari that doesn't support webp:
   ```
   +++++++++ Incoming Request +++++++++
   -- State Machine Id: 0
   GET http:///eyJrZXkiOiJ1cGxvYWRzL21lZGl1bS9hc3NldC8xODE4L3Rlc2xhX3dpdGhfYV9yb3NlX29uX3RvcF9vZl9pdC5qcGciLCJidWNrZXQiOiJvc2xvLXByb2R1Y3Rpb24iLCJlZGl0cyI6eyJyZXNpemUiOnsid2lkdGgiOjcwMCwiaGVpZ2h0IjpudWxsfX19 HTTP/1.1
   Host: 192.168.1.10:8080
   Connection: keep-alive
   Accept: image/png,image/svg+xml,image/*;q=0.8,video/*;q=0.8,*/*;q=0.5
   User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15
   Accept-Language: en-us
   Referer: http://192.168.1.10:81/safari.html
   Accept-Encoding: gzip, deflate
   ```


----------------------------------------------------------------
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] ywkaras commented on issue #7099: ATS will send image/webp content to browsers that don't support it

Posted by GitBox <gi...@apache.org>.
ywkaras commented on issue #7099:
URL: https://github.com/apache/trafficserver/issues/7099#issuecomment-672002428


   @SolidWallOfCode can txnbox match on Safari in User-Agent and change image/* in Accept to a comma separated list like image/jpeg, image/gif, etc (with any q value used with image/*)?  Would that fix this problem?


----------------------------------------------------------------
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] bryancall commented on issue #7099: ATS will send image/webp content to browsers that don't support it

Posted by GitBox <gi...@apache.org>.
bryancall commented on issue #7099:
URL: https://github.com/apache/trafficserver/issues/7099#issuecomment-672142929


   @ywkaras It won't work since the origin doesn't recognize q values and will send back image/webp again, since it has image/webp in the accept header.
   
   It would however work if image/webp;q=0 is added before doing an ATS cache look up and then removed before going to the origin.  I think we should just special case image/webp for now and remove it later in a few years.  I have an internal PR up that has that type of logic.


----------------------------------------------------------------
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] bryancall edited a comment on issue #7099: ATS will send image/webp content to browsers that don't support it

Posted by GitBox <gi...@apache.org>.
bryancall edited a comment on issue #7099:
URL: https://github.com/apache/trafficserver/issues/7099#issuecomment-672142929


   @ywkaras It won't work since the origin doesn't recognize q values and will send back image/webp again, since it has image/webp in the accept header.
   
   It would however work if image/webp;q=0 is added before doing an ATS cache look up and then removed before going to the origin.  I think we should just special case image/webp for now and remove it later in a few years.  I have an internal PR up that has that type of logic.
   
   
   Example of the origin sending back `content-type: image/webp` with `Accept: image/webp;q=0` in the request:
   ```
   $ curl -D - -o /dev/null -s -H 'Accept: image/webp;q=0,image/png,image/svg+xml,image/*;q=0.8,video/*;q=0.8,*/*;q=0.5' https://dlp31coh2a67q.cloudfront.net/eyJrZXkiOiJ1cGxvYWRzL21lZGl1bS9hc3NldC8xODE4L3Rlc2xhX3dpdGhfYV9yb3NlX29uX3RvcF9vZl9pdC5qcGciLCJidWNrZXQiOiJvc2xvLXByb2R1Y3Rpb24iLCJlZGl0cyI6eyJyZXNpemUiOnsid2lkdGgiOjcwMCwiaGVpZ2h0IjpudWxsfX19
   HTTP/2 200
   content-type: image/webp
   content-length: 18472
   date: Tue, 11 Aug 2020 17:54:50 GMT
   x-amzn-requestid: 70f95e04-b159-45e2-9c38-f4ede3d38153
   last-modified: Wed, 22 Jul 2020 21:31:31 GMT
   access-control-allow-origin: *
   access-control-allow-headers: Content-Type, Authorization
   x-amz-apigw-id: RHc4sFKFiYcF2pg=
   cache-control: max-age=31536000,public
   access-control-allow-methods: GET
   x-amzn-trace-id: Root=1-5f32db6a-2865172535c54d6d87203e86;Sampled=0
   access-control-allow-credentials: true
   x-cache: Hit from cloudfront
   via: 1.1 7eb3b782ab09047ce0d11ee03763894c.cloudfront.net (CloudFront)
   x-amz-cf-pop: SEA19-C2
   x-amz-cf-id: 1HPCddByV7clafDzYTNPOxMcgpn_LM-ajvqyQfGh4jVwHnhZ-NvCuw==
   age: 2
   ```


----------------------------------------------------------------
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] bryancall closed issue #7099: ATS will send image/webp content to browsers that don't support it

Posted by GitBox <gi...@apache.org>.
bryancall closed issue #7099:
URL: https://github.com/apache/trafficserver/issues/7099


   


----------------------------------------------------------------
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