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
질문됨 2년 전348회 조회
1개 답변
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
전문가
Paul_L
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠