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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则