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?

demandé il y a 2 ans209 vues
2 réponses
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
répondu il y a un an
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.

répondu il y a 3 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions