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?

preguntada hace 2 años209 visualizaciones
2 Respuestas
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
respondido hace un año
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.

respondido hace 3 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas