1 Answer
- Newest
- Most votes
- Most comments
1
S3 does support Byte-Range fetches, it is also recommended like you suggested to get better throughput when fetching different ranges in parallel. This is described in the Best Practices Design Patterns: Optimizing Amazon S3 Performance Whitepaper.
I also ran a test using an S3 object via a presigned URL and curl through the CLI.
Fetching the entire file:
curl "URL HERE" -i HTTP/1.1 200 OK x-amz-id-2: 000000000 x-amz-request-id: 000000000 Date: Wed, 14 Jun 2023 12:33:38 GMT Last-Modified: Wed, 14 Jun 2023 12:31:54 GMT ETag: "000000000" x-amz-server-side-encryption: AES256 Content-Disposition: inline Accept-Ranges: bytes Content-Type: text/plain Server: AmazonS3 Content-Length: 19 this is a test file
Fetching the first two bytes.
curl "URL HERE" -i -H "Range: bytes=0-1" HTTP/1.1 206 Partial Content x-amz-id-2: 000000000 x-amz-request-id: 000000000 Date: Wed, 14 Jun 2023 12:34:10 GMT Last-Modified: Wed, 14 Jun 2023 12:31:54 GMT ETag: "000000000" x-amz-server-side-encryption: AES256 Content-Disposition: inline Accept-Ranges: bytes Content-Range: bytes 0-1/19 Content-Type: text/plain Server: AmazonS3 Content-Length: 2 th
I've edited the values returned by x-amz-id-2
, x-amz-request-id
and ETag
to save space as they are not relevant to the snippet.
answered a year ago
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Thanks for the anwser
But would something like this works as well or i cannot request multiple ranges in a single curl request?
curl "URL HERE" -i -H "Range: bytes=0-1,10-20"
Hi, thank you for bringing that up, S3 does not currently support multiple ranges in a GET request. This is outlined in the documentation: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html