为什么 appsync 添加 x-amz-cf-id 作为响应 header

Why appsync adds x-amz-cf-id as a response header

来自文档 here

CloudFront adds the header to the viewer request before forwarding the request to your origin. The header value contains an encrypted string that uniquely identifies the request.

现在,在客户端(邮递员)上检查我的 appsync 响应时,我发现 x-amz-cf-id 作为响应 header。但我确定我的系统与 CloudFront 无关,

我的问题,

  1. appsync 是否使用 cloudfront(默认情况下在内部某处)?
  2. 这 header 在什么情况下添加到我的应用程序同步响应中?
  3. 关于 appsync(cloudfront-req-id 当然除外)它告诉我(客户端)什么?

appsync、api 网关、cognito 和其他许多服务在 AWS backend/internally 中使用 cloudFront 以实现高性能和减少延迟等目的。 CloudFront 只是扮演一个反向代理的角色,没有别的。

因为 CloudFront 始终提供 x-amz-cf-id header 作为响应,可用于跟踪单个请求(字符串是唯一的),除非 AWS 要求您,否则不会将此用于 appsync如果您联系他们,请提供他来跟踪一些失败的请求。

当您解析 appsync 端点并对该 IP 地址执行反向 dns 时,您会看到它实际上使用了 cloudfront。