cmcfarlen commented on pull request #8657:
URL: https://github.com/apache/trafficserver/pull/8657#issuecomment-1047244507


   
   I setup a scenario to try to answer the question about short ranges and 
caching the full asset.  TL;DR: It caches the full response
   
   ### Scenario
   
   - https as the origin to serve a ~50MB file configured to ignore ranges to 
always return a 200 and the full request
   - ATS mapping to origin with this new feature turned on to transform 200 to 
206 and cache the full response (staring with an empty cache)
   - curl client requesting to close the connection and requesting a range.
   
   Here is the simple request script:
   
   ```
   #!/bin/sh
   curl -v -o first.bin  --header "Connection: close" --header 'Range: 
bytes=0-10' http://ats:8080/docker.iso &
   sleep 0.1  # added or both requests would be cache misses
   curl -v -o second.bin  --header "Connection: close" --header 'Range: 
bytes=10000000-' http://ats:8080/docker.iso &
   ```
   
   ### Expected behavior
   
   The first request will cause ats start the transfer from origin, 
transforming the response and sending 11 bytes to the client and caching the 
full response.
   The second request will do a RWW and serve the request from the cache as its 
written
   
   ### Results
   
   (I removed the output related to the transfer progress, leaving just the 
verbose output)
   
   ```
   * Connected to ats (127.0.0.1) port 8080 (#0)
   > GET /docker.iso HTTP/1.1
   > Host: ats:8080
   > User-Agent: curl/7.77.0
   > Accept: */*
   > Connection: close
   > Range: bytes=0-10
   >
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 206 Partial Content
   < Date: Mon, 21 Feb 2022 20:31:36 GMT
   < Server: ATS/10.0.0
   < Last-Modified: Mon, 21 Feb 2022 17:59:12 GMT
   < ETag: "3000000-5d88afd724296"
   < Accept-Ranges: none
   < Cache-Control: public, max-age=60, must-revalidate
   < Content-Type: application/x-iso9660-image
   < Content-Range: bytes 0-10/50331648
   < Content-Length: 11
   < Age: 0
   < Connection: close
   < Via: http/1.1 traffic_server (ApacheTrafficServer/10.0.0 [uScMsSfWpSeN:t 
cCMp sS])
   <
   * Closing connection 0
   
   * Connected to ats (127.0.0.1) port 8080 (#0)
   > GET /docker.iso HTTP/1.1
   > Host: ats:8080
   > User-Agent: curl/7.77.0
   > Accept: */*
   > Connection: close
   > Range: bytes=10000000-
   >
   $ * Mark bundle as not supporting multiuse
   < HTTP/1.1 206 Partial Content
   < Date: Mon, 21 Feb 2022 20:31:36 GMT
   < Server: ATS/10.0.0
   < Last-Modified: Mon, 21 Feb 2022 17:59:12 GMT
   < ETag: "3000000-5d88afd724296"
   < Accept-Ranges: none
   < Cache-Control: public, max-age=60, must-revalidate
   < Content-Type: application/x-iso9660-image
   < Content-Range: bytes 10000000-50331647/50331648
   < Content-Length: 40331648
   < Age: 0
   < Connection: close
   < Via: http/1.1 traffic_server (ApacheTrafficServer/10.0.0 [uScWs f p eN:t 
cCHp s ])
   <
   * Closing connection 0
   ```
   
   A subsequent request for the full content will serve the full resource from 
cache:
   
   ```
   < Content-Length: 50331648
   < Cache-Control: public, max-age=60, must-revalidate
   < Content-Type: application/x-iso9660-image
   < Age: 9
   < Connection: close
   < Via: http/1.1 traffic_server (ApacheTrafficServer/10.0.0 [uScHs f p eN:t 
cCHp s ])
   ```
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to