Partial requests to Cloudfront

0

When a partial GET request (with Range header specified) is sent to Cloudfront and caching is enabled, Cloudfront may internally increase Range header value (according to docs: "To optimize performance, CloudFront may request a larger range than the client requested in the Range GET")

In my case, Cloudfront returns as a viewer response body this larger part of a object instead of the smaller part that the client originally requested, e.g.:

  • viewer request with Range: bytes=0-511999
  • Cloudfront changes Range value to Range: bytes=0-1048575 and sends it to origin
  • Origin reponse includes Content-Length: 1048576
  • Viewer response also includes Content-Length: 1048576. I would like to get only the first 512000 bytes as a response.

Is this standard Cloudfront behavior or is there any option how to get only the client-requested part of the object in response?

asked 2 years ago204 views
2 Answers
0

It's odd. The behavior of CF to request a larger range does not mean it would return larger piece/chuck to the viewer. Can you share it with us, if the issue still persists? If yes, you should create a support case(with x-amz-cf-id information) and seek the help from AWS Premium Support team.

profile pictureAWS
Kenex_H
answered 10 months ago
0

This issue was resolved by modifying the API Gateway that was used as the Origin for this CloudFront endpoint. HTTP code 206 in the Integration response was not defined.

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions