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?

posta 2 anni fa209 visualizzazioni
2 Risposte
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
con risposta 10 mesi fa
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.

con risposta 3 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande