High Latency from CloudFront to Non-AWS Origin



I hope this message finds you well.

I am seeking assistance to improve the latency, or reduce ping times, between CloudFront and my non-AWS origin server located in Frankfurt. Despite enabling Origin Shield and selecting the nearest region, which is eu-central-1 (the same region as my server), I continue to experience high latency.

To provide you with more context, my origin server is not an AWS product. I would greatly appreciate any guidance or insights on how to optimize the connection and achieve lower latency.

Your help and expertise in this matter would be highly valuable. Thank you in advance for your assistance.

Best regards,


asked 6 months ago186 views
2 Answers
  • Is it wire latency or app latency ?
  • What is the Origin IP/Prefix ? whois -h whois.cymru.com " -v <origin-ip>" --> this should give you the ASN, Prefix

curl -Iv https://<cloudfront-Alternate Name/ your hostname fronted by CF>

Response headers

HTTP/1.1 200 OK
Server: CloudFront
Content-Length: 915
Connection: keep-alive
X-Amz-Cf-Pop: BJS9-E1 --> Share this
X-Amz-Cf-Id:  --> Share this

Create a case with Support with above curl outputs and they should be able to assist you and check the latency between CF POP <<< >> Non AWS Origin

  • It's not secure to post your Origin details here and it's hard to assist without above information.
profile picture
answered 5 months ago


You may want to run the command to check which step do you see latency in:

curl -w "DNS_resolution: %{time_namelookup}| TCP_negotiation_time: %{time_connect}| SSL_negotiation_time: %{time_appconnect}| TTFB: %{time_starttransfer}| Total time: %{time_total} \n" -o /dev/null -vsL https://www.example.com

If CloudFront returns "X-Cache:Hit from cloudfront" in response, there is latency in the answer given back by Cloudfront itself, it doesn't send back to origin.

If, CloudFront returns "X-Cache:Miss from cloudfront" when the request is sent to the origin. You may want to turn on origin latency metric to know exact time origin took to send the first byte. Then, Check if sending a request from any frankfurt server to origin is causing latency. If, yes, latency is on origin side. To avoid latency caused by Cloudfront when forwarding requests to the origin, refer to : https://repost.aws/knowledge-center/cloudfront-latency-xcache

answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions