Time to First Byte (TTFB) is a key performance metric that directly impacts the user experience of any online store. Recently, while comparing the TTFB of a large Shopify Plus store—a UK expansion store for UK customers—with a standard Shopify demo store, we noticed significant differences in response times, even on cache hits. Both requests were generated from the UK.
How We Identified the Issue
Initially, we observed slower network response times on the Shopify Plus store, which prompted a deeper investigation. By reviewing the Server Response headers including Server-Timing, we identified that the times were much slower for our store compared to the demo and that the x-dc header, which indicates the data center routing, showed that in our Plus store we are being routed through an EU datacenter to a US data centre whereas the demo store was served entirely from an EU datacenter.
Here’s a summary of the key findings:
Shopify Plus Store (UK-based):
• TTFB: 526ms
• Data Center Routing (x-dc): gcp-europe-west4, gcp-us-central1, gcp-us-central1
• Cloudflare Request Duration: 207ms
• Server Processing Time: 60ms
Shopify Demo Store (Theme Store):
• TTFB: 70ms
• Data Center Routing (x-dc): gcp-europe-west1, gcp-europe-west1, gcp-europe-west1
• Cloudflare Request Duration: 56ms
• Server Processing Time: 18ms
Key Findings
The x-dc header revealed that the Shopify Plus store is frequently routed through U.S. data centers (gcp-us-central1), despite both requests being made from the UK and the store serving a UK customer base. In contrast, the Shopify demo store is consistently routed through European data centers (gcp-europe-west1), leading to much faster TTFB.
Aside from the data center routing, there was no significant difference between other key metrics such as Cloudflare request duration or server processing time. This suggests that the data center routing is the main factor contributing to the slower performance of the Plus store.
The Search for Answers
We’ve spoken with various types of Shopify support, including Merchant Success and technical support, but have been unable to get any information on whether there are ways to optimise routing or why this issue is occurring.
We’re not looking for trade secrets on how Shopify routes data through different centre. Instead, we want to know whether there’s anything we can do via the theme or installed apps to prevent the need for routing through U.S. data centers, or whether this routing is entirely unrelated to the site’s build and only depends on traffic patterns or Shopify’s infrastructure decisions.
Conclusion
By reviewing Server-Timing HTTP headers and analysing the x-dc header, it’s clear that routing through U.S. data centers is the primary contributor to slower TTFB on the Shopify Plus store, despite it being a UK-based store serving UK customers. Understanding whether this is something we can influence through the site build or configuration would help developers optimise their stores more effectively.
If anyone in the community has encountered similar issues or has insight into how to improve data center routing for Shopify Plus stores, would love to hear your thoughts.