From 498015e53a10cc71ac472dc5a55d301207894727 Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Mon, 18 May 2026 15:17:24 +0200 Subject: [PATCH 01/13] [Speed] Add comprehensive slow website troubleshooting guide Creates a new troubleshooting page that guides users through: - Identifying specific slow assets (not just 'my site is slow') - Using Observatory to analyze performance and enable optimizations - Analyzing origin performance with Origin Analytics - Using curl --write-out for detailed timing metrics - Investigating cache status with Cache Analytics - Diagnosing network issues with speed.cloudflare.com and MTR - Understanding network routing and how Argo Smart Routing helps The guide progresses from basic (browser dev tools) to advanced (MTR, curl timing) to serve both non-technical and technical users. Addresses SPM-2864 --- .../speed/troubleshooting-slow-website.mdx | 319 ++++++++++++++++++ 1 file changed, 319 insertions(+) create mode 100644 src/content/docs/speed/troubleshooting-slow-website.mdx diff --git a/src/content/docs/speed/troubleshooting-slow-website.mdx b/src/content/docs/speed/troubleshooting-slow-website.mdx new file mode 100644 index 000000000000000..6a8b57635af9d8a --- /dev/null +++ b/src/content/docs/speed/troubleshooting-slow-website.mdx @@ -0,0 +1,319 @@ +--- +title: Troubleshooting a slow website +pcx_content_type: troubleshooting +description: Identify and resolve performance issues affecting your website. +products: + - speed +sidebar: + order: 10 +head: + - tag: title + content: Troubleshooting a slow website +--- + +import { Details, Render, Tabs, TabItem, GlossaryTooltip } from "~/components"; + +This guide helps you identify and resolve performance issues affecting your website. It starts with basic diagnostics and progresses to advanced troubleshooting techniques. + +## Before you start + +Saying "my website is slow" is not enough to diagnose a performance issue. To effectively troubleshoot, you need to: + +1. **Identify specific slow requests** - Determine which URLs, assets, or API endpoints are slow. +2. **Measure the slowness** - Quantify the delay (for example, "this image takes 5 seconds to load"). +3. **Reproduce the issue** - Confirm the slowness is consistent and not a one-time occurrence. + +--- + +## Step 1: Identify slow assets + +The first step is to identify which specific resources are causing slowness. A slow website is usually caused by one or more slow assets, not the entire site. + +### Use browser developer tools + +1. Open your browser's developer tools (press `F12` or right-click and select **Inspect**). +2. Go to the **Network** tab. +3. Reload the page and observe which requests take the longest. +4. Sort by **Time** or **Duration** to identify the slowest assets. +5. Note the specific URLs of slow resources. + +Look for: +- Large images or videos +- Slow API calls +- Third-party scripts +- Render-blocking resources + +### Generate a HAR file + +For a complete record of all requests, [generate a HAR file](/support/troubleshooting/general-troubleshooting/gathering-information-for-troubleshooting-sites/#generate-a-har-file). This captures timing information for every request and is useful when working with Cloudflare Support. + +--- + +## Step 2: Use Observatory to analyze performance + +[Observatory](/speed/observatory/) provides synthetic tests and real user monitoring (RUM) data to assess your website's performance. + +### Run a speed test + +1. Go to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/:zone/speed). +2. Select **Observatory**. +3. Enter the URL you want to test and select **Run test**. + +### Understand the results + +Observatory reports key metrics: + +| Metric | What it measures | Target | +|--------|------------------|--------| +| **Largest Contentful Paint (LCP)** | Time until the largest visible element loads | Under 2.5 seconds | +| **First Contentful Paint (FCP)** | Time until the first content appears | Under 1.8 seconds | +| **Cumulative Layout Shift (CLS)** | Visual stability during page load | Under 0.1 | +| **Time to First Byte (TTFB)** | Time until the first byte of response is received | Under 800ms | +| **Total Blocking Time (TBT)** | Time the main thread is blocked | Under 200ms | + +### Enable recommended optimizations + +Based on Observatory results, enable relevant [Speed optimizations](/speed/optimization/): + +- [Auto Minify](/speed/optimization/content/auto-minify/) - Reduce file sizes by removing unnecessary characters +- [Brotli compression](/speed/optimization/content/brotli/) - Compress responses for faster transfer +- [Early Hints](/cache/advanced-configuration/early-hints/) - Preload critical resources +- [HTTP/2 and HTTP/3](/speed/optimization/protocol/) - Use modern protocols for faster connections +- [Image optimization](/images/) - Automatically optimize and resize images + +--- + +## Step 3: Analyze origin performance + +If your website is slow, the issue may be at your origin server. Use Origin Analytics to understand how your origin is performing. + +### Check origin response times + +In the Cloudflare dashboard: + +1. Go to **Analytics & Logs** > **Traffic**. +2. Review the **Origin Response Time** metrics. +3. Look for patterns in slow responses (specific paths, times of day, or geographic regions). + +High origin response times indicate your origin server is struggling. Consider: +- Upgrading your hosting plan +- Optimizing database queries +- Implementing server-side caching +- Using a CDN for static assets + +--- + +## Step 4: Measure performance with curl + +For detailed timing metrics on specific requests, use `curl` with the `--write-out` option. + +### Basic performance test + +```bash +curl -w "\n\nDNS Lookup: %{time_namelookup}s\nTCP Connect: %{time_connect}s\nTLS Handshake: %{time_appconnect}s\nTime to First Byte: %{time_starttransfer}s\nTotal Time: %{time_total}s\n" -o /dev/null -s https://www.example.com/slow-asset.jpg +``` + +This outputs: + +```txt +DNS Lookup: 0.025s +TCP Connect: 0.045s +TLS Handshake: 0.120s +Time to First Byte: 0.350s +Total Time: 1.250s +``` + +### Understanding the metrics + +| Metric | Description | High value indicates | +|--------|-------------|---------------------| +| **DNS Lookup** | Time to resolve the domain name | DNS issues or slow resolver | +| **TCP Connect** | Time to establish TCP connection | Network latency or server distance | +| **TLS Handshake** | Time to complete SSL/TLS negotiation | Certificate chain issues or slow server | +| **Time to First Byte (TTFB)** | Time until first response byte | Slow origin processing | +| **Total Time** | Complete request duration | Large file size or slow transfer | + +### Test from different locations + +To test from different geographic locations, use online tools like: +- [KeyCDN Tools](https://tools.keycdn.com/performance) +- [Uptrends](https://www.uptrends.com/tools/website-speed-test) +- [Dotcom-Tools](https://www.dotcom-tools.com/website-speed-test) + +--- + +## Step 5: Investigate caching + +Uncached content must be fetched from your origin server, adding latency. Use [Cache Analytics](/cache/performance-review/cache-analytics/) to understand your cache performance. + +### Check if assets are cached + +Use `curl` to check the cache status of a specific asset: + +```bash +curl -sI https://www.example.com/asset.jpg | grep -i "cf-cache-status" +``` + +Possible values: + +| Status | Meaning | Action | +|--------|---------|--------| +| **HIT** | Served from Cloudflare cache | No action needed | +| **MISS** | Not in cache, fetched from origin | May need cache rules | +| **DYNAMIC** | Not eligible for caching | Create a cache rule if static | +| **BYPASS** | Cache intentionally bypassed | Review cache rules | +| **EXPIRED** | Cached copy was stale | Increase Edge TTL | +| **REVALIDATED** | Cloudflare confirmed content is current | Increase Edge TTL | + +For a complete list, refer to [Cloudflare cache responses](/cache/concepts/cache-responses/). + +### Use Cache Analytics + +1. Go to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/:zone/caching). +2. Review the **Cache Performance** section. +3. Filter by **Cache status equals MISS** or **DYNAMIC** to identify uncached content. + +### Cache static content + +If static assets (images, CSS, JavaScript) are not being cached: + +1. Go to **Caching** > **Cache Rules**. +2. Create a rule to [cache static content](/cache/how-to/cache-rules/examples/cache-everything/). +3. Set appropriate [Edge TTLs](/cache/how-to/cache-rules/settings/#edge-ttl). + +
+ +- **Cache-Control headers from origin** - Your origin may send `Cache-Control: no-cache` or `private` headers. Override these with a Cache Rule. +- **Set-Cookie headers** - Responses with `Set-Cookie` are not cached by default. Use a Cache Rule to ignore cookies for static assets. +- **Query strings** - Different query strings create different cache entries. Use a [custom cache key](/cache/how-to/cache-rules/examples/custom-cache-key/) to normalize. +- **Dynamic content type** - HTML and API responses are not cached by default. Create explicit cache rules if appropriate. + +
+ +--- + +## Step 6: Diagnose network issues + +If curl shows high TCP Connect or TLS Handshake times, the issue may be network-related rather than application-related. + +### Test your Internet connection + +Visit [speed.cloudflare.com](https://speed.cloudflare.com) to test: +- Download and upload speeds +- Latency (ping) +- Jitter +- Packet loss + +Poor results indicate issues with your local network or ISP. + +### Run MTR from your location to Cloudflare + +MTR combines traceroute and ping to show latency and packet loss at each network hop. + + + + +```bash +mtr -rw www.example.com +``` + + + + +Download [WinMTR](https://github.com/White-Tiger/WinMTR/releases) and run it with your domain as the target. + + + + +Look for: +- **High latency** at specific hops (indicates slow network segments) +- **Packet loss** (indicates network congestion or issues) +- **Timeouts** (may indicate firewalls or routing issues) + +For more details, refer to [How to read MTR](https://www.cloudflare.com/learning/network-layer/what-is-mtr/). + +### Run MTR from your origin to Cloudflare + +If you have access to your origin server, run MTR from the origin to a [Cloudflare IP address](https://www.cloudflare.com/ips/) to test the network path between your origin and Cloudflare. + +```bash +mtr -rw 104.16.132.229 +``` + +High latency or packet loss on this path affects all requests that miss the cache. + +--- + +## Step 7: Understand network routing + +How requests are routed to Cloudflare data centers can significantly impact performance. + +### Identify which data center serves your requests + +Add `/cdn-cgi/trace` to your domain to see which Cloudflare data center is serving your requests: + +```bash +curl https://www.example.com/cdn-cgi/trace +``` + +The `colo` field shows the three-letter airport code of the serving data center (for example, `colo=SJC` for San Jose). + +### Why routing matters + +When a request reaches Cloudflare: + +1. The request is routed to the nearest Cloudflare data center based on anycast routing. +2. If the content is cached, it is served immediately. +3. If not cached, Cloudflare fetches from your origin server. + +If your origin server is geographically distant from the Cloudflare data center serving your users, uncached requests will be slow. + +### Solutions for origin distance + +| Solution | Description | Best for | +|----------|-------------|----------| +| **Improve cache hit ratio** | Cache more content to reduce origin fetches | All sites | +| **[Tiered Cache](/cache/how-to/tiered-cache/)** | Use upper-tier data centers to reduce origin requests | Sites with global traffic | +| **[Argo Smart Routing](/argo-smart-routing/)** | Route traffic over faster network paths | Sites with slow origin connections | +| **Move origin closer** | Deploy origin servers in multiple regions | Large-scale applications | + +### Enable Argo Smart Routing + +[Argo Smart Routing](/argo-smart-routing/) analyzes network conditions in real-time and routes traffic over the fastest paths, reducing latency by an average of 30%. + +1. Go to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/:zone/traffic). +2. Select **Argo Smart Routing**. +3. Enable the feature. + +Argo is particularly effective when: +- Your origin is far from your users +- Network congestion affects certain paths +- You need consistent performance globally + +--- + +## Summary checklist + +Use this checklist to systematically troubleshoot slow website performance: + +- [ ] Identify specific slow assets using browser developer tools +- [ ] Run Observatory tests and review Core Web Vitals +- [ ] Enable recommended Speed optimizations +- [ ] Check origin response times in Analytics +- [ ] Use `curl` to measure detailed timing for slow assets +- [ ] Verify assets are being cached using Cache Analytics +- [ ] Create cache rules for static content that is not cached +- [ ] Test network performance with speed.cloudflare.com +- [ ] Run MTR to identify network path issues +- [ ] Check which Cloudflare data center serves your requests +- [ ] Consider Argo Smart Routing for improved routing + +--- + +## Related resources + +- [Observatory](/speed/observatory/) - Test and monitor website performance +- [Cache Analytics](/cache/performance-review/cache-analytics/) - Analyze cache hit rates +- [Cache Rules](/cache/how-to/cache-rules/) - Control what gets cached +- [Argo Smart Routing](/argo-smart-routing/) - Optimize network routing +- [Gathering information for troubleshooting](/support/troubleshooting/general-troubleshooting/gathering-information-for-troubleshooting-sites/) - Collect diagnostic data From f1d88c59fadac4fa33e09469030039275798b43e Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Mon, 18 May 2026 15:23:35 +0200 Subject: [PATCH 02/13] Use more empathetic language in intro --- src/content/docs/speed/troubleshooting-slow-website.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/speed/troubleshooting-slow-website.mdx b/src/content/docs/speed/troubleshooting-slow-website.mdx index 6a8b57635af9d8a..29a7a39a17c305d 100644 --- a/src/content/docs/speed/troubleshooting-slow-website.mdx +++ b/src/content/docs/speed/troubleshooting-slow-website.mdx @@ -17,7 +17,7 @@ This guide helps you identify and resolve performance issues affecting your webs ## Before you start -Saying "my website is slow" is not enough to diagnose a performance issue. To effectively troubleshoot, you need to: +Performance issues are easier to solve when you can pinpoint exactly what is slow. To effectively troubleshoot, start by gathering the following information: 1. **Identify specific slow requests** - Determine which URLs, assets, or API endpoints are slow. 2. **Measure the slowness** - Quantify the delay (for example, "this image takes 5 seconds to load"). @@ -151,7 +151,7 @@ Uncached content must be fetched from your origin server, adding latency. Use [C Use `curl` to check the cache status of a specific asset: ```bash -curl -sI https://www.example.com/asset.jpg | grep -i "cf-cache-status" +curl -s -D- -o /dev/null https://www.example.com/asset.jpg | grep -i "cf-cache-status" ``` Possible values: From 25d4147ca222f08a7a90171e74a0ee6b8bc967a1 Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Mon, 18 May 2026 15:34:58 +0200 Subject: [PATCH 03/13] Move slow website guide to /speed/troubleshooting/ folder - Moved troubleshooting-slow-website.mdx to troubleshooting/slow-website.mdx - Moved troubleshooting.mdx to troubleshooting/index.mdx - Updated index to use DirectoryListing component --- .../speed/{troubleshooting.mdx => troubleshooting/index.mdx} | 4 ++-- .../slow-website.mdx} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/content/docs/speed/{troubleshooting.mdx => troubleshooting/index.mdx} (58%) rename src/content/docs/speed/{troubleshooting-slow-website.mdx => troubleshooting/slow-website.mdx} (99%) diff --git a/src/content/docs/speed/troubleshooting.mdx b/src/content/docs/speed/troubleshooting/index.mdx similarity index 58% rename from src/content/docs/speed/troubleshooting.mdx rename to src/content/docs/speed/troubleshooting/index.mdx index 1a73653e90dc280..db1bb7fddc9a776 100644 --- a/src/content/docs/speed/troubleshooting.mdx +++ b/src/content/docs/speed/troubleshooting/index.mdx @@ -10,9 +10,9 @@ sidebar: --- -import { ResourcesBySelector } from "~/components" +import { DirectoryListing } from "~/components" The following topics are useful for troubleshooting Speed issues. - + diff --git a/src/content/docs/speed/troubleshooting-slow-website.mdx b/src/content/docs/speed/troubleshooting/slow-website.mdx similarity index 99% rename from src/content/docs/speed/troubleshooting-slow-website.mdx rename to src/content/docs/speed/troubleshooting/slow-website.mdx index 29a7a39a17c305d..29a9d4e974daa6b 100644 --- a/src/content/docs/speed/troubleshooting-slow-website.mdx +++ b/src/content/docs/speed/troubleshooting/slow-website.mdx @@ -5,7 +5,7 @@ description: Identify and resolve performance issues affecting your website. products: - speed sidebar: - order: 10 + order: 1 head: - tag: title content: Troubleshooting a slow website From 181940fc444d403b9086ab582b4798a016247d2b Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Mon, 18 May 2026 15:52:54 +0200 Subject: [PATCH 04/13] Improve slow website troubleshooting guide - Remove deprecated Auto Minify reference - Update Origin Analytics location to Speed > Origin Analytics - Remove 'Using a CDN for static assets' (covered in cache section) - Expand caching intro to explain why caching improves performance - Split cache section into 'Investigate why not cached' and 'Cache additional content' - Update Argo section to mention Smart Shield and correct enable links --- .../speed/troubleshooting/slow-website.mdx | 48 ++++++++++++------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/src/content/docs/speed/troubleshooting/slow-website.mdx b/src/content/docs/speed/troubleshooting/slow-website.mdx index 29a9d4e974daa6b..2fb9d24b5f07ff8 100644 --- a/src/content/docs/speed/troubleshooting/slow-website.mdx +++ b/src/content/docs/speed/troubleshooting/slow-website.mdx @@ -75,7 +75,6 @@ Observatory reports key metrics: Based on Observatory results, enable relevant [Speed optimizations](/speed/optimization/): -- [Auto Minify](/speed/optimization/content/auto-minify/) - Reduce file sizes by removing unnecessary characters - [Brotli compression](/speed/optimization/content/brotli/) - Compress responses for faster transfer - [Early Hints](/cache/advanced-configuration/early-hints/) - Preload critical resources - [HTTP/2 and HTTP/3](/speed/optimization/protocol/) - Use modern protocols for faster connections @@ -91,7 +90,7 @@ If your website is slow, the issue may be at your origin server. Use Origin Anal In the Cloudflare dashboard: -1. Go to **Analytics & Logs** > **Traffic**. +1. Go to **Speed** > **Origin Analytics**. 2. Review the **Origin Response Time** metrics. 3. Look for patterns in slow responses (specific paths, times of day, or geographic regions). @@ -99,7 +98,6 @@ High origin response times indicate your origin server is struggling. Consider: - Upgrading your hosting plan - Optimizing database queries - Implementing server-side caching -- Using a CDN for static assets --- @@ -144,7 +142,9 @@ To test from different geographic locations, use online tools like: ## Step 5: Investigate caching -Uncached content must be fetched from your origin server, adding latency. Use [Cache Analytics](/cache/performance-review/cache-analytics/) to understand your cache performance. +Caching is one of the most effective ways to improve website performance. When content is cached, Cloudflare serves it directly from a data center close to your visitors, eliminating the round trip to your origin server. This can reduce response times from hundreds of milliseconds to just a few milliseconds. + +Uncached content must travel from the visitor to Cloudflare, then to your origin server, and back again. Use [Cache Analytics](/cache/performance-review/cache-analytics/) to understand your cache performance and identify opportunities to cache more content. ### Check if assets are cached @@ -173,22 +173,29 @@ For a complete list, refer to [Cloudflare cache responses](/cache/concepts/cache 2. Review the **Cache Performance** section. 3. Filter by **Cache status equals MISS** or **DYNAMIC** to identify uncached content. -### Cache static content +### Investigate why static content is not cached -If static assets (images, CSS, JavaScript) are not being cached: +If static assets (images, CSS, JavaScript) show a cache status of `DYNAMIC`, `BYPASS`, or `MISS`, investigate the cause: -1. Go to **Caching** > **Cache Rules**. -2. Create a rule to [cache static content](/cache/how-to/cache-rules/examples/cache-everything/). -3. Set appropriate [Edge TTLs](/cache/how-to/cache-rules/settings/#edge-ttl). +| Symptom | Likely cause | Solution | +|---------|--------------|----------| +| `DYNAMIC` status | Content type not in [default file extensions](/cache/concepts/default-cache-behavior/#default-cached-file-extensions) | Create a Cache Rule to cache the content | +| `DYNAMIC` status | Origin sends `Cache-Control: private` or `no-store` | Create a Cache Rule to [override origin cache control](/cache/how-to/cache-rules/settings/#origin-cache-control) | +| `BYPASS` status | A Cache Rule is bypassing cache | Review your [Cache Rules](/cache/how-to/cache-rules/) configuration | +| `MISS` on every request | Response includes `Set-Cookie` header | Configure your origin to not set cookies on static assets, or use a Cache Rule to [ignore cookies](/cache/how-to/cache-rules/examples/ignore-set-cookie-header/) | +| `MISS` with query strings | Different query strings create different cache entries | Use a [custom cache key](/cache/how-to/cache-rules/examples/custom-cache-key/) to ignore or normalize query strings | -
+### Cache additional static content -- **Cache-Control headers from origin** - Your origin may send `Cache-Control: no-cache` or `private` headers. Override these with a Cache Rule. -- **Set-Cookie headers** - Responses with `Set-Cookie` are not cached by default. Use a Cache Rule to ignore cookies for static assets. -- **Query strings** - Different query strings create different cache entries. Use a [custom cache key](/cache/how-to/cache-rules/examples/custom-cache-key/) to normalize. -- **Dynamic content type** - HTML and API responses are not cached by default. Create explicit cache rules if appropriate. +By default, Cloudflare only caches certain [file extensions](/cache/concepts/default-cache-behavior/#default-cached-file-extensions). To cache additional static content: -
+1. Go to **Caching** > **Cache Rules**. +2. Create a rule to [cache specific content](/cache/how-to/cache-rules/examples/cache-everything/). +3. Set appropriate [Edge TTLs](/cache/how-to/cache-rules/settings/#edge-ttl). + +:::caution +Be careful when caching HTML or API responses. These often contain personalized or dynamic content that should not be cached. Only cache content you are certain is static. +::: --- @@ -281,15 +288,20 @@ If your origin server is geographically distant from the Cloudflare data center [Argo Smart Routing](/argo-smart-routing/) analyzes network conditions in real-time and routes traffic over the fastest paths, reducing latency by an average of 30%. -1. Go to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/:zone/traffic). -2. Select **Argo Smart Routing**. -3. Enable the feature. +Argo Smart Routing is part of [Smart Shield](/smart-shield/), which bundles multiple Cloudflare performance and reliability features. + +To enable Argo Smart Routing: + +1. Go to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/:zone/smart-shield). +2. Follow the [Smart Shield setup guide](/smart-shield/get-started/) to enable the feature. Argo is particularly effective when: - Your origin is far from your users - Network congestion affects certain paths - You need consistent performance globally +For detailed information about how Argo Smart Routing works, refer to the [Argo Smart Routing documentation](/argo-smart-routing/). + --- ## Summary checklist From 7b45262a7b8cce0c3573aa72f69a118ff81b7f48 Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Mon, 18 May 2026 16:27:24 +0200 Subject: [PATCH 05/13] Restore ResourcesBySelector in troubleshooting index Restores the original behavior that lists all faq/troubleshooting pages from the entire speed directory, not just the troubleshooting folder. --- src/content/docs/speed/troubleshooting/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/speed/troubleshooting/index.mdx b/src/content/docs/speed/troubleshooting/index.mdx index db1bb7fddc9a776..1a73653e90dc280 100644 --- a/src/content/docs/speed/troubleshooting/index.mdx +++ b/src/content/docs/speed/troubleshooting/index.mdx @@ -10,9 +10,9 @@ sidebar: --- -import { DirectoryListing } from "~/components" +import { ResourcesBySelector } from "~/components" The following topics are useful for troubleshooting Speed issues. - + From 9f61eb2200c6c94fce719c04365d2ce5fd219cf3 Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Mon, 18 May 2026 16:46:22 +0200 Subject: [PATCH 06/13] Add 'Verify traffic goes through Cloudflare' section and expand routing troubleshooting Based on support case analysis: - Added prominent section at the start to verify cf-ray header and DNS proxy status - Expanded Step 7 with 'Troubleshoot unexpected routing' subsection - Corrected routing information: Cloudflare prioritizes reliability over proximity - Added plan-based routing differences (Enterprise vs other plans) - Added link to geographic-traffic-routing troubleshooting page - Updated summary checklist to include verification step --- .../speed/troubleshooting/slow-website.mdx | 63 ++++++++++++++++++- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/src/content/docs/speed/troubleshooting/slow-website.mdx b/src/content/docs/speed/troubleshooting/slow-website.mdx index 2fb9d24b5f07ff8..d42154982c91056 100644 --- a/src/content/docs/speed/troubleshooting/slow-website.mdx +++ b/src/content/docs/speed/troubleshooting/slow-website.mdx @@ -15,9 +15,44 @@ import { Details, Render, Tabs, TabItem, GlossaryTooltip } from "~/components"; This guide helps you identify and resolve performance issues affecting your website. It starts with basic diagnostics and progresses to advanced troubleshooting techniques. -## Before you start +## Before you start: Verify traffic goes through Cloudflare -Performance issues are easier to solve when you can pinpoint exactly what is slow. To effectively troubleshoot, start by gathering the following information: +Before troubleshooting performance, confirm that your traffic is actually going through Cloudflare. If requests bypass Cloudflare, the issue is not related to Cloudflare and this guide will not help. + +### Check for the cf-ray header + +Every response served through Cloudflare includes a `cf-ray` header. Use `curl` to check: + +```bash +curl -sI https://www.example.com | grep -i cf-ray +``` + +If you see a `cf-ray` header (for example, `cf-ray: 8a1b2c3d4e5f6g7h-SJC`), your traffic is going through Cloudflare. If not, check your DNS configuration. + +### Verify DNS is pointing to Cloudflare + +Your domain must resolve to Cloudflare IP addresses for traffic to be proxied: + +```bash +dig +short www.example.com +``` + +The returned IP addresses should be [Cloudflare IPs](https://www.cloudflare.com/ips/). If they point directly to your origin server, your DNS records are not proxied. + +To fix this: +1. Go to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/:zone/dns). +2. Find the DNS record for the slow hostname. +3. Ensure the **Proxy status** is set to **Proxied** (orange cloud icon). + +:::note +If your DNS records are set to **DNS only** (gray cloud), Cloudflare does not proxy the traffic and cannot improve performance. The request goes directly to your origin server. +::: + +--- + +## Gather information about the slow requests + +Performance issues are easier to solve when you can pinpoint exactly what is slow. Start by gathering the following information: 1. **Identify specific slow requests** - Determine which URLs, assets, or API endpoints are slow. 2. **Measure the slowness** - Quantify the delay (for example, "this image takes 5 seconds to load"). @@ -263,7 +298,7 @@ Add `/cdn-cgi/trace` to your domain to see which Cloudflare data center is servi curl https://www.example.com/cdn-cgi/trace ``` -The `colo` field shows the three-letter airport code of the serving data center (for example, `colo=SJC` for San Jose). +The `colo` field shows the three-letter airport code of the serving data center (for example, `colo=SJC` for San Jose). You can find the full list of Cloudflare data centers and their codes on the [Cloudflare status page](https://www.cloudflarestatus.com/). ### Why routing matters @@ -275,6 +310,27 @@ When a request reaches Cloudflare: If your origin server is geographically distant from the Cloudflare data center serving your users, uncached requests will be slow. +### Troubleshoot unexpected routing + +If requests are being routed to a data center that seems far from the user, this may be due to Cloudflare's traffic engineering decisions or how the user's ISP routes traffic. + +Cloudflare continuously adds capacity to its global network and enhances automated traffic engineering systems to intelligently manage congestion and other network events. While Cloudflare always strives to provide the best possible performance by serving traffic from the closest location, **reliability is the top priority**. In instances where performance and reliability are in conflict, Cloudflare's systems are designed to prioritize a stable connection over a local one. + +Additionally, routing behavior varies by plan: +- **Enterprise zones** are prioritized for routing to the closest data center. +- **Other plans** may experience routing variations based on operational conditions. + +For more details, refer to [Cloudflare traffic not being sent to the geographically closest data center](/support/troubleshooting/general-troubleshooting/geographic-traffic-routing/). + +Common causes of unexpected routing: + +| Symptom | Likely cause | What you can do | +|---------|--------------|----------------| +| Requests route to a distant data center | Cloudflare traffic engineering for reliability, or ISP routing | Enable Argo Smart Routing for optimized paths | +| Routing changes between requests | Network conditions or ISP load balancing | Normal behavior - routing adapts to conditions | +| Consistent routing to a distant region | ISP peering location or Cloudflare capacity management | Consider upgrading to Enterprise or enable Argo Smart Routing | +| High latency despite nearby data center | Network congestion on the path | Enable Argo Smart Routing to optimize the path | + ### Solutions for origin distance | Solution | Description | Best for | @@ -308,6 +364,7 @@ For detailed information about how Argo Smart Routing works, refer to the [Argo Use this checklist to systematically troubleshoot slow website performance: +- [ ] Verify traffic is going through Cloudflare (check for `cf-ray` header) - [ ] Identify specific slow assets using browser developer tools - [ ] Run Observatory tests and review Core Web Vitals - [ ] Enable recommended Speed optimizations From 329ade822dbef575063ab84e953f3d60b3a277c6 Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Mon, 18 May 2026 17:06:59 +0200 Subject: [PATCH 07/13] Simplify routing troubleshooting table - Remove plan-based routing information - Remove 'What you can do' column from table - Rename 'Likely cause' to 'Explanation' - Move 'Normal behavior' note into explanation for routing changes --- .../docs/speed/troubleshooting/slow-website.mdx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/content/docs/speed/troubleshooting/slow-website.mdx b/src/content/docs/speed/troubleshooting/slow-website.mdx index d42154982c91056..a168723a2633922 100644 --- a/src/content/docs/speed/troubleshooting/slow-website.mdx +++ b/src/content/docs/speed/troubleshooting/slow-website.mdx @@ -316,20 +316,16 @@ If requests are being routed to a data center that seems far from the user, this Cloudflare continuously adds capacity to its global network and enhances automated traffic engineering systems to intelligently manage congestion and other network events. While Cloudflare always strives to provide the best possible performance by serving traffic from the closest location, **reliability is the top priority**. In instances where performance and reliability are in conflict, Cloudflare's systems are designed to prioritize a stable connection over a local one. -Additionally, routing behavior varies by plan: -- **Enterprise zones** are prioritized for routing to the closest data center. -- **Other plans** may experience routing variations based on operational conditions. - For more details, refer to [Cloudflare traffic not being sent to the geographically closest data center](/support/troubleshooting/general-troubleshooting/geographic-traffic-routing/). Common causes of unexpected routing: -| Symptom | Likely cause | What you can do | -|---------|--------------|----------------| -| Requests route to a distant data center | Cloudflare traffic engineering for reliability, or ISP routing | Enable Argo Smart Routing for optimized paths | -| Routing changes between requests | Network conditions or ISP load balancing | Normal behavior - routing adapts to conditions | -| Consistent routing to a distant region | ISP peering location or Cloudflare capacity management | Consider upgrading to Enterprise or enable Argo Smart Routing | -| High latency despite nearby data center | Network congestion on the path | Enable Argo Smart Routing to optimize the path | +| Symptom | Explanation | +|---------|-------------| +| Requests route to a distant data center | Cloudflare traffic engineering for reliability, or ISP routing decisions | +| Routing changes between requests | Normal behavior - routing adapts to network conditions or ISP load balancing | +| Consistent routing to a distant region | ISP peering location or Cloudflare capacity management | +| High latency despite nearby data center | Network congestion on the path | ### Solutions for origin distance From 534719816bd3b302b359358a7f2187aee2386438 Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Mon, 18 May 2026 17:09:56 +0200 Subject: [PATCH 08/13] Fix broken links reported by CI - /speed/optimization/content/brotli/ -> /speed/optimization/content/compression/ - /cache/how-to/cache-rules/examples/ignore-set-cookie-header/ -> /cache/concepts/cache-behavior/#interaction-of-set-cookie-response-header-with-cache --- src/content/docs/speed/troubleshooting/slow-website.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/speed/troubleshooting/slow-website.mdx b/src/content/docs/speed/troubleshooting/slow-website.mdx index a168723a2633922..491f10b64e40160 100644 --- a/src/content/docs/speed/troubleshooting/slow-website.mdx +++ b/src/content/docs/speed/troubleshooting/slow-website.mdx @@ -110,7 +110,7 @@ Observatory reports key metrics: Based on Observatory results, enable relevant [Speed optimizations](/speed/optimization/): -- [Brotli compression](/speed/optimization/content/brotli/) - Compress responses for faster transfer +- [Brotli compression](/speed/optimization/content/compression/) - Compress responses for faster transfer - [Early Hints](/cache/advanced-configuration/early-hints/) - Preload critical resources - [HTTP/2 and HTTP/3](/speed/optimization/protocol/) - Use modern protocols for faster connections - [Image optimization](/images/) - Automatically optimize and resize images @@ -217,7 +217,7 @@ If static assets (images, CSS, JavaScript) show a cache status of `DYNAMIC`, `BY | `DYNAMIC` status | Content type not in [default file extensions](/cache/concepts/default-cache-behavior/#default-cached-file-extensions) | Create a Cache Rule to cache the content | | `DYNAMIC` status | Origin sends `Cache-Control: private` or `no-store` | Create a Cache Rule to [override origin cache control](/cache/how-to/cache-rules/settings/#origin-cache-control) | | `BYPASS` status | A Cache Rule is bypassing cache | Review your [Cache Rules](/cache/how-to/cache-rules/) configuration | -| `MISS` on every request | Response includes `Set-Cookie` header | Configure your origin to not set cookies on static assets, or use a Cache Rule to [ignore cookies](/cache/how-to/cache-rules/examples/ignore-set-cookie-header/) | +| `MISS` on every request | Response includes `Set-Cookie` header | Configure your origin to not set cookies on static assets, or use a Cache Rule to [ignore cookies](/cache/concepts/cache-behavior/#interaction-of-set-cookie-response-header-with-cache) | | `MISS` with query strings | Different query strings create different cache entries | Use a [custom cache key](/cache/how-to/cache-rules/examples/custom-cache-key/) to ignore or normalize query strings | ### Cache additional static content From 5d0eeb28b8baf14b636971fb93b7ff50a403cbbe Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Mon, 18 May 2026 17:11:15 +0200 Subject: [PATCH 09/13] Apply suggestions from code review Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com> --- .../speed/troubleshooting/slow-website.mdx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/content/docs/speed/troubleshooting/slow-website.mdx b/src/content/docs/speed/troubleshooting/slow-website.mdx index 491f10b64e40160..94c79092d066f04 100644 --- a/src/content/docs/speed/troubleshooting/slow-website.mdx +++ b/src/content/docs/speed/troubleshooting/slow-website.mdx @@ -11,7 +11,7 @@ head: content: Troubleshooting a slow website --- -import { Details, Render, Tabs, TabItem, GlossaryTooltip } from "~/components"; +import { Details, DashButton, Tabs, TabItem, GlossaryTooltip } from "~/components"; This guide helps you identify and resolve performance issues affecting your website. It starts with basic diagnostics and progresses to advanced troubleshooting techniques. @@ -66,7 +66,7 @@ The first step is to identify which specific resources are causing slowness. A s ### Use browser developer tools -1. Open your browser's developer tools (press `F12` or right-click and select **Inspect**). +1. Open your browser's developer tools. 2. Go to the **Network** tab. 3. Reload the page and observe which requests take the longest. 4. Sort by **Time** or **Duration** to identify the slowest assets. @@ -90,7 +90,9 @@ For a complete record of all requests, [generate a HAR file](/support/troublesho ### Run a speed test -1. Go to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/:zone/speed). +1. Go to the Cloudflare dashboard. + + 2. Select **Observatory**. 3. Enter the URL you want to test and select **Run test**. @@ -103,8 +105,8 @@ Observatory reports key metrics: | **Largest Contentful Paint (LCP)** | Time until the largest visible element loads | Under 2.5 seconds | | **First Contentful Paint (FCP)** | Time until the first content appears | Under 1.8 seconds | | **Cumulative Layout Shift (CLS)** | Visual stability during page load | Under 0.1 | -| **Time to First Byte (TTFB)** | Time until the first byte of response is received | Under 800ms | -| **Total Blocking Time (TBT)** | Time the main thread is blocked | Under 200ms | +| **Time to First Byte (TTFB)** | Time until the first byte of response is received | Under 800 ms | +| **Total Blocking Time (TBT)** | Time the main thread is blocked | Under 200 ms | ### Enable recommended optimizations @@ -156,7 +158,9 @@ Time to First Byte: 0.350s Total Time: 1.250s ``` -### Understanding the metrics +### Understand the metrics + +The curl timing breakdown shows the following: | Metric | Description | High value indicates | |--------|-------------|---------------------| @@ -204,7 +208,9 @@ For a complete list, refer to [Cloudflare cache responses](/cache/concepts/cache ### Use Cache Analytics -1. Go to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/:zone/caching). +1. Go to the Cloudflare dashboard. + + 2. Review the **Cache Performance** section. 3. Filter by **Cache status equals MISS** or **DYNAMIC** to identify uncached content. @@ -329,6 +335,8 @@ Common causes of unexpected routing: ### Solutions for origin distance +Consider these solutions based on your needs: + | Solution | Description | Best for | |----------|-------------|----------| | **Improve cache hit ratio** | Cache more content to reduce origin fetches | All sites | From 7ef1fa66774e5f8d6202245357f4b2aaa1d09186 Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Mon, 18 May 2026 17:13:54 +0200 Subject: [PATCH 10/13] Simplify routing explanation wording --- src/content/docs/speed/troubleshooting/slow-website.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/speed/troubleshooting/slow-website.mdx b/src/content/docs/speed/troubleshooting/slow-website.mdx index 94c79092d066f04..6d981b576be1cb2 100644 --- a/src/content/docs/speed/troubleshooting/slow-website.mdx +++ b/src/content/docs/speed/troubleshooting/slow-website.mdx @@ -320,7 +320,7 @@ If your origin server is geographically distant from the Cloudflare data center If requests are being routed to a data center that seems far from the user, this may be due to Cloudflare's traffic engineering decisions or how the user's ISP routes traffic. -Cloudflare continuously adds capacity to its global network and enhances automated traffic engineering systems to intelligently manage congestion and other network events. While Cloudflare always strives to provide the best possible performance by serving traffic from the closest location, **reliability is the top priority**. In instances where performance and reliability are in conflict, Cloudflare's systems are designed to prioritize a stable connection over a local one. +While Cloudflare always strives to provide the best possible performance by serving traffic from the closest location, reliability is the top priority. In instances where performance and reliability are in conflict, Cloudflare's systems are designed to prioritize a stable connection over a local one. For more details, refer to [Cloudflare traffic not being sent to the geographically closest data center](/support/troubleshooting/general-troubleshooting/geographic-traffic-routing/). From 2eda9b7f002a5c632f77a9c86e88d620d7de6218 Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Mon, 18 May 2026 18:38:56 +0200 Subject: [PATCH 11/13] Improve routing section wording and add anycast link --- src/content/docs/speed/troubleshooting/slow-website.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/speed/troubleshooting/slow-website.mdx b/src/content/docs/speed/troubleshooting/slow-website.mdx index 6d981b576be1cb2..c5eaaeff0f5700c 100644 --- a/src/content/docs/speed/troubleshooting/slow-website.mdx +++ b/src/content/docs/speed/troubleshooting/slow-website.mdx @@ -310,7 +310,7 @@ The `colo` field shows the three-letter airport code of the serving data center When a request reaches Cloudflare: -1. The request is routed to the nearest Cloudflare data center based on anycast routing. +1. The request is routed to a nearby Cloudflare data center based on anycast [routing](https://www.cloudflare.com/learning/cdn/glossary/anycast-network/). 2. If the content is cached, it is served immediately. 3. If not cached, Cloudflare fetches from your origin server. @@ -318,7 +318,7 @@ If your origin server is geographically distant from the Cloudflare data center ### Troubleshoot unexpected routing -If requests are being routed to a data center that seems far from the user, this may be due to Cloudflare's traffic engineering decisions or how the user's ISP routes traffic. +If requests are being routed to a data center that seems far from the user, this may be due to Cloudflare's automated traffic engineering or a user’s ISP routing traffic. While Cloudflare always strives to provide the best possible performance by serving traffic from the closest location, reliability is the top priority. In instances where performance and reliability are in conflict, Cloudflare's systems are designed to prioritize a stable connection over a local one. From 2414409330ca8ec5ef5a5a372e8944e56a4ca90e Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Mon, 18 May 2026 18:41:47 +0200 Subject: [PATCH 12/13] Fix curl command to properly show headers --- src/content/docs/speed/troubleshooting/slow-website.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/speed/troubleshooting/slow-website.mdx b/src/content/docs/speed/troubleshooting/slow-website.mdx index c5eaaeff0f5700c..5c2d0b91ac425dd 100644 --- a/src/content/docs/speed/troubleshooting/slow-website.mdx +++ b/src/content/docs/speed/troubleshooting/slow-website.mdx @@ -24,7 +24,7 @@ Before troubleshooting performance, confirm that your traffic is actually going Every response served through Cloudflare includes a `cf-ray` header. Use `curl` to check: ```bash -curl -sI https://www.example.com | grep -i cf-ray +curl -s -D- -o /dev/null https://www.example.com | grep -i cf-ray ``` If you see a `cf-ray` header (for example, `cf-ray: 8a1b2c3d4e5f6g7h-SJC`), your traffic is going through Cloudflare. If not, check your DNS configuration. From d34c0c5d6dbcdd89cc5b2f2bb026ec5b80a22e1a Mon Sep 17 00:00:00 2001 From: Nicolas Gayerie Date: Tue, 19 May 2026 14:30:24 +0200 Subject: [PATCH 13/13] Add Rocket Loader, HTTP/2 multiplexing explanation, and Workers troubleshooting - Add Rocket Loader to recommended optimizations - Expand HTTP/2 description to explain multiplexing benefits - Add new section on checking for slow Workers as cause of high TTFB --- .../speed/troubleshooting/slow-website.mdx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/content/docs/speed/troubleshooting/slow-website.mdx b/src/content/docs/speed/troubleshooting/slow-website.mdx index 5c2d0b91ac425dd..9351b392411ab5a 100644 --- a/src/content/docs/speed/troubleshooting/slow-website.mdx +++ b/src/content/docs/speed/troubleshooting/slow-website.mdx @@ -114,8 +114,9 @@ Based on Observatory results, enable relevant [Speed optimizations](/speed/optim - [Brotli compression](/speed/optimization/content/compression/) - Compress responses for faster transfer - [Early Hints](/cache/advanced-configuration/early-hints/) - Preload critical resources -- [HTTP/2 and HTTP/3](/speed/optimization/protocol/) - Use modern protocols for faster connections +- [HTTP/2 and HTTP/3](/speed/optimization/protocol/) - Use modern protocols with multiplexing, allowing multiple requests over a single connection instead of opening separate connections for each asset - [Image optimization](/images/) - Automatically optimize and resize images +- [Rocket Loader](/speed/optimization/content/rocket-loader/) - Defer loading of JavaScript to improve paint times --- @@ -136,6 +137,22 @@ High origin response times indicate your origin server is struggling. Consider: - Optimizing database queries - Implementing server-side caching +### Check for slow Workers + +If your zone has [Cloudflare Workers](/workers/) deployed, they execute on every matching request and add to the total response time. A slow Worker is a common cause of high TTFB. + +To check if Workers are affecting performance: + +1. Go to **Workers & Pages** in the Cloudflare dashboard. +2. Review which Workers are deployed on your zone. +3. Check the **Analytics** for each Worker to see execution times. +4. Temporarily disable Workers to isolate whether they are causing the slowness. + +If a Worker is slow, review its code for: +- Slow external API calls or `fetch()` requests +- Inefficient loops or data processing +- Missing `await` statements causing sequential instead of parallel execution + --- ## Step 4: Measure performance with curl