Lambda@Edge custom 'Server-Timing' missing

0

I have a Lambda@Edge on origin-request and it returns a Server-Timing header, however the value is ignored or missing.

According to the Cloudfront documentation on Server-Timing header metrics:

"The response that CloudFront sends to the viewer contains a single Server-Timing header that includes the value that came from the origin and the metrics that CloudFront added." (emphasis mine)

I also don't see any documentation saying Lambda@Edge it's not allowed to return a Server-Timing header.

Here are the steps I tried:

  • Setting the response header policy with a "Custom headers" set to Server-Timing and override false, the value is always missing.
  • Setting the response header with "Server-Timing header" enabled returns only Cloudfront metrics and ignores my custom Lambda@Edge response.

Looks like a bug or missing documentation, thank you in advance!

profile picture
posta 2 anni fa348 visualizzazioni
1 Risposta
0

Is your Lambda function generating and returning the whole response? If it is passing the request through to an origin, I think you'd need to add server-timing on the Origin Response trigger, rather than Origin Request. Either way, the server-timing header generated by your Lambda@Edge function or the Origin will only be sent to the user in the event of a cache miss. If your requests are being served from cache, the value generated by the origin or Lambda@Edge for server-timing will not be present.

AWS
ESPERTO
Paul_L
con risposta 2 anni 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