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
preguntada hace 2 años348 visualizaciones
1 Respuesta
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
EXPERTO
Paul_L
respondido hace 2 años

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