Troubleshooting a slow website·续
Cache additional static content
By default, Cloudflare only caches certain file extensions. To cache additional static content:
- Go to Caching > Cache Rules.
- Create a rule to cache specific content.
- Set appropriate Edge TTLs.
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.
Use Cloudflare Trace to debug cache rules
If your cache rules are not applying as expected, use Cloudflare Trace to simulate a request and see exactly which rules match. Trace shows you how your Cloudflare configurations (including cache rules, page rules, and other settings) would affect a specific URL.
This is particularly useful when:
- A cache rule should be caching content but the response shows
DYNAMICorBYPASS - You are unsure which rule is taking precedence
- You want to test a "what-if" scenario before making changes
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 ↗︎ 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.
mtr -rw www.example.com
Download WinMTR ↗︎ 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 ↗︎.
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 ↗︎ to test the network path between your origin and Cloudflare.
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:
curl https://www.example.com/cdn-cgi/trace
Invoke-RestMethod -Uri "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). You can find the full list of Cloudflare data centers and their codes on the Cloudflare status page ↗︎.
Why routing matters
When a request reaches Cloudflare:
- The request is routed to a nearby Cloudflare data center based on anycast routing ↗︎.
- If the content is cached, it is served immediately.
- 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.
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 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.
For more details, refer to Cloudflare traffic not being sent to the geographically closest data center.
Common causes of unexpected routing:
| 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
Consider these solutions based on your needs:
| Solution | Description | Best for |
|---|---|---|
| Improve cache hit ratio | Cache more content to reduce origin fetches | All sites |
| Tiered Cache | Use upper-tier data centers to reduce origin requests | Sites with global traffic |
| 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 analyzes network conditions in real-time and routes traffic over the fastest paths, reducing latency by an average of 30%.
Argo Smart Routing is part of Smart Shield, which bundles multiple Cloudflare performance and reliability features.
To enable Argo Smart Routing:
- Go to the Cloudflare dashboard ↗︎.
- Follow the Smart Shield setup guide 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.
Contact Support if the problem persists
If you have followed the steps above and the performance issue persists, contact Cloudflare Support for assistance.
When contacting Support, provide as much evidence as possible to help diagnose the issue:
- HAR file - Generate a HAR file that captures the slow requests. This provides detailed timing information for every request.
- Observatory results - Share screenshots or links to your Observatory test results.
- RUM data - If you have Web Analytics enabled, share relevant metrics showing the performance issue.
- curl output - Include the timing breakdown from
curl --write-outfor the slow assets. - MTR results - If you suspect network issues, include MTR output from your location to the affected domain.
- Specific URLs - List the exact URLs that are slow, along with the expected and actual response times.
The more evidence you provide showing the slowness, the faster Support can identify and resolve the issue.
Related resources
- Observatory - Test and monitor website performance
- Cache Analytics - Analyze cache hit rates
- Cache Rules - Control what gets cached
- Argo Smart Routing - Optimize network routing
- Gathering information for troubleshooting - Collect diagnostic data
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/speed/troubleshooting/slow-website/#page","headline":"Troubleshooting a slow website","description":"Identify and resolve performance issues affecting your website.","url":"https://developers.cloudflare.com/speed/troubleshooting/slow-website/","inLanguage":"en","image":"https://developers.cloudflare.com/speed/troubleshooting/slow-website/og.png?v=cfe21a7978e4e2ad","dateModified":"2026-06-16","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Measure real-world internet quality metrics for your visitors. title: Aggregated Internet Measurement image: https://developers.cloudflare.com/speed/aim/og.png?v=a2e9effb49d900ce
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/speed/llms.txt
Use this file to discover all available pages before exploring further.
Docs