[ 
https://issues.apache.org/jira/browse/TS-3995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15000000#comment-15000000
 ] 

ASF GitHub Bot commented on TS-3995:
------------------------------------

Github user ngorchilov commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/330#discussion_r44505183
  
    --- Diff: proxy/http/HttpTransactCache.cc ---
    @@ -1299,7 +1299,7 @@ 
HttpTransactCache::match_response_to_request_conditionals(HTTPHdr *request, HTTP
           ink_time_t lm_value = response->get_last_modified();
     
           // we won't return NOT_MODIFIED if Last-modified is too recent
    -      if ((lm_value == 0) || (request->get_if_modified_since() < 
lm_value)) {
    --- End diff --
    
    Why Akamai are using such technique is beyond my knowledge, but regarding 
ATS logic I have the following comments/opinion:
    
    1. when running in forwarding mode, especially in TPROXY, it shall be as 
less intrusive as possible, instead of being standards enforcement facility and 
breaking unknown (but in tens if not hundreds of thousands) number of 
services/sites that are working somehow otherwise.
    
    Imagine the case (our use case, actually) when running in transparent 
forwarding mode for ISPs ranging from few tens of thousands to few million 
subscribers. End-users don't care if their ISP is willing to save some 
bandwidth or not. They call the customer support and complain - this online 
facility works for me via your competitor, make it work for me or I quit.
    
    If ATS community is serious to support forwarding mode, it shall follow the 
logic of best commercial solutions - PeerApp or alike - they NEVER break 
services intentionally, just because they can :)
    
    2. Regarding If-modified-since - I don't think standards somehow imply that 
server MUST respond with 304. Especially with the edge case of 
If-modified-since equal to Last-modified - it’s pretty legit and unavoidable 
race condition - while I (the server) started serving you the last version some 
other subprocess finished updating the object in the very same second.
    
    IMHO, ATS shall forward the 200 response, especially if triggered by client 
If-modified-since, not by IMS, at least while running in 
proxy.config.http.cache.when_to_revalidate = 4, if this makes any difference.


> "[hcoofsr] conditional request, 200 response, send back 304 if possible 
> [crc=304]" breaks akamaihd.net live streaming
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: TS-3995
>                 URL: https://issues.apache.org/jira/browse/TS-3995
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Cache, Core, HTTP
>    Affects Versions: 5.3.2
>            Reporter: Nikolai Gorchilov
>              Labels: review
>             Fix For: 6.1.0
>
>
> Caching proxy running ATS 5.3.x (5.3.0, 5.3.1, 5.3.2 all fail) with 
> proxy.config.http.cache.when_to_revalidate = 4 breaks akamaihd.net live 
> streaming.
> The actual problem is that ATS rewrites origin response from 200 to 304, due 
> to If-Modified-Since conditional header in client's request. As per ATS logic 
> object is unmodified, but in fact it is. Most probably player and server 
> somehow play with if-modified-since/last-modified headers pair to communicate 
> position in the live stream. What is obvious is that Last-Modified = 
> If-Modified-Since.
> As result, Akamai player keeps repeating the said request, expecting it's 
> 200, but getting 304 thus live video freezes forever, just a few seconds 
> after start.
> IMHO when proxy.config.http.cache.when_to_revalidate = 4, ATS shall not 
> interfere with origin response in this manner.
> Here's a debug log of request and response headers at different states in a 
> single transaction:
> {noformat}
> +++++++++ Incoming Request +++++++++
> -- State Machine Id: 168
> GET 
> http:///z/delayed/indvsa2015_INDVSSATEST1DAY1_1@336263/464_209823ecd2922291-p.bootstrap?g=YCEAMIWDQZQT&hdntl=exp=1446809835~acl=%2f*~data=hdntl~hmac=ebaedb13781605ce7f9f26b84e1346a7d43ecf0dfcc99e6b53e32487565ba3f8&hdcore=3.7.0&plugin=aasp-3.7.0.39.44
>  HTTP/1.1
> Host: sshds5-lh.akamaihd.net
> Connection: keep-alive
> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) 
> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
> X-Requested-With: ShockwaveFlash/19.0.0.226
> Accept: */*
> DNT: 1
> Referer: http://www.hotstar.com/
> Accept-Encoding: gzip
> Accept-Language: en-US,en;q=0.8,bg;q=0.6
> Cookie: _alid_=PmjLqgcUUqw6TP5gtK/xbg==; 
> hdntl=exp=1446809835~acl=%2f*~data=hdntl~hmac=ebaedb13781605ce7f9f26b84e1346a7d43ecf0dfcc99e6b53e32487565ba3f8
> If-Modified-Since: Thu, 05 Nov 2015 02:30:28 GMT
> +++++++++ Proxy's Request +++++++++
> -- State Machine Id: 168
> GET 
> /z/delayed/indvsa2015_INDVSSATEST1DAY1_1@336263/464_209823ecd2922291-p.bootstrap?g=YCEAMIWDQZQT&hdntl=exp=1446809835~acl=%2f*~data=hdntl~hmac=ebaedb13781605ce7f9f26b84e1346a7d43ecf0dfcc99e6b53e32487565ba3f8&hdcore=3.7.0&plugin=aasp-3.7.0.39.44
>  HTTP/1.1
> Host: sshds5-lh.akamaihd.net
> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) 
> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
> X-Requested-With: ShockwaveFlash/19.0.0.226
> Accept: */*
> DNT: 1
> Referer: http://www.hotstar.com/
> Accept-Encoding: gzip
> Accept-Language: en-US,en;q=0.8,bg;q=0.6
> Cookie: _alid_=PmjLqgcUUqw6TP5gtK/xbg==; 
> hdntl=exp=1446809835~acl=%2f*~data=hdntl~hmac=ebaedb13781605ce7f9f26b84e1346a7d43ecf0dfcc99e6b53e32487565ba3f8
> If-Modified-Since: Thu, 05 Nov 2015 02:30:28 GMT
> +++++++++ Proxy's Request after hooks +++++++++
> -- State Machine Id: 168
> GET 
> /z/delayed/indvsa2015_INDVSSATEST1DAY1_1@336263/464_209823ecd2922291-p.bootstrap?g=YCEAMIWDQZQT&hdntl=exp=1446809835~acl=%2f*~data=hdntl~hmac=ebaedb13781605ce7f9f26b84e1346a7d43ecf0dfcc99e6b53e32487565ba3f8&hdcore=3.7.0&plugin=aasp-3.7.0.39.44
>  HTTP/1.1
> Host: sshds5-lh.akamaihd.net
> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) 
> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
> X-Requested-With: ShockwaveFlash/19.0.0.226
> Accept: */*
> DNT: 1
> Referer: http://www.hotstar.com/
> Accept-Encoding: gzip
> Accept-Language: en-US,en;q=0.8,bg;q=0.6
> Cookie: _alid_=PmjLqgcUUqw6TP5gtK/xbg==; 
> hdntl=exp=1446809835~acl=%2f*~data=hdntl~hmac=ebaedb13781605ce7f9f26b84e1346a7d43ecf0dfcc99e6b53e32487565ba3f8
> If-Modified-Since: Thu, 05 Nov 2015 02:30:28 GMT
> +++++++++ Incoming O.S. Response +++++++++
> -- State Machine Id: 168
> HTTP/1.1 200 OK
> Server: AkamaiGHost
> Mime-Version: 1.0
> Content-Type: video/abst
> Content-Length: 122
> Last-Modified: Thu, 05 Nov 2015 02:30:28 GMT
> Expires: Thu, 05 Nov 2015 11:38:01 GMT
> Cache-Control: max-age=0, no-cache
> Pragma: no-cache
> Date: Thu, 05 Nov 2015 11:38:01 GMT
> Connection: keep-alive
> Set-Cookie: _alid_=PmjLqgcUUqw6TP5gtK/xbg==; 
> path=/z/delayed/indvsa2015_INDVSSATEST1DAY1_1@336263/; 
> domain=sshds5-lh.akamaihd.net
> +++++++++ Base Header for Building Response +++++++++
> -- State Machine Id: 168
> HTTP/1.1 200 OK
> Server: AkamaiGHost
> Mime-Version: 1.0
> Content-Type: video/abst
> Content-Length: 122
> Last-Modified: Thu, 05 Nov 2015 02:30:28 GMT
> Expires: Thu, 05 Nov 2015 11:38:01 GMT
> Cache-Control: max-age=0, no-cache
> Pragma: no-cache
> Date: Thu, 05 Nov 2015 11:38:01 GMT
> Connection: keep-alive
> Set-Cookie: _alid_=PmjLqgcUUqw6TP5gtK/xbg==; 
> path=/z/delayed/indvsa2015_INDVSSATEST1DAY1_1@336263/; 
> domain=sshds5-lh.akamaihd.net
> +++++++++ Proxy's Response 2 +++++++++
> -- State Machine Id: 168
> HTTP/1.1 304 Not Modified
> Date: Thu, 05 Nov 2015 11:38:01 GMT
> Expires: Thu, 05 Nov 2015 11:38:01 GMT
> Cache-Control: max-age=0, no-cache
> Connection: keep-alive
> +++++++++ Proxy's Response (Client Conditionals) +++++++++
> -- State Machine Id: 168
> HTTP/1.1 304 Not Modified
> Date: Thu, 05 Nov 2015 11:38:01 GMT
> Expires: Thu, 05 Nov 2015 11:38:01 GMT
> Cache-Control: max-age=0, no-cache
> Connection: keep-alive
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to