Troubleshooting and optimizing site speed

Diagnose the most common site performance issues and learn about Cloudflare options for improving latency and page load time.


Troubleshooting overview

If your site is loading slowly, use the following steps to troubleshoot:

  1. Examine your origin web server for excess load or traffic. Ask your hosting provider to help review your origin web server health.
  2. Use webpagetest.org to confirm whether the slowness occurs via Cloudflare or directly at your origin web server.
  3. Review Cloudflare options to optimize performance.

Test performance with Webpagetest.org

You can use webpagetest.org to troubleshoot speed issues. webpagetest.org tests site speed and provides data on resource load time (images, CSS, HTML etc). webpagetest.org helps rule out local Internet issues such as a poor Internet connection.

To assess the cause of slowness:

  1. run a test with Cloudflare,
  2. test direct to your origin web server, and
  3. review page load speed results.

Testing with Cloudflare

If Cloudflare is currently enabled to proxy your site traffic (not temporarily paused or grey-clouded), determine your page speed through Cloudflare:

  1. Visit https://www.webpagetest.org/.
  2. Choose a geographic Test Location and a Browser that closely matches the browser and location of your visitor experiencing slow page loads.
  3. Enter the URL for a slow loading page and click START TEST.
Your first results likely contain uncached resources and provide inaccurate results for purposes of comparison. Run a second test before saving results.
  1. Copy the browser URL to your completed test results in case you need to open a ticket with Cloudflare support.

Testing directly to your origin web server

Temporarily pause Cloudflare or grey-cloud the subdomain’s DNS record in the Cloudflare DNS app to test performance while bypassing Cloudflare:

  1. Visit https://www.webpagetest.org/.
  2. Choose the same geographic Test Location and Browser as your Test with Cloudflare.
  3. Enter the same URL as used for your Test with Cloudflare and click START TEST.
  4. Copy the browser URL to your completed test results in case you need to open a ticket with Cloudflare support.

Review page load speed results

Review your average page load speed:

  1. Click Plot Full Results under Performance Results.
  2. Scroll to Load Time and review the Mean time.
  3. Compare the following between the Cloudflare and direct-to-origin tests:
  • If Mean page load to the origin server is slower than through Cloudflare, investigate the source of slowness with your hosting provider.
  • Slowness for only the first request of a resource indicates your server took too long to generate a response. The first time a resource is requested, it is likely uncached at Cloudflare and the request has to go to your origin server. Investigate slowness with your hosting provider.
  • If Mean page load to the origin server is faster than through Cloudflare, open a Cloudflare support ticket providing the following details:
    • The slow URL
    • The webpagetest.org URLs you compared. Provide the direct URL links to test results, rather than a screenshot or attachment.
    • A traceroute to your domain.
  1. Review Cloudflare options to optimize performance

Optimize site performance

There are several common methods of using Cloudflare to optimize site speed:

Optimize caching

Cloudflare’s caching configuration is deliberately cautious by default. Review what Cloudflare static file types are cached by default:


To cache static HTML, use a Cache Everything Page Rule. Caching static HTML isn’t suitable for dynamic content such as login or shopping cart pages. However, Business and Enterprise customers can avoid accidental caching of login or shopping cart pages while still caching HTML by creating a Bypass Cache on Cookie Page Rule.

Use HTTPS for HTTP/2 support

HTTP/2 is the latest version of the HTTP protocol and includes improvements designed to accelerate page load. Only HTTPS sites support HTTP/2.

Use Cloudflare Page Rules instead of origin redirects

Use Cloudflare’s Page Rules for site forwarding as an alternative to implementing redirects at your origin web server. Using Page Rules for forwarding site traffic redirects from Cloudflare’s edge which eliminates a slower connection to your origin web server.

Leverage Cloudflare Mirage and Polish (Paid Plans)

Upgrade from a Free Cloudflare plan to access Cloudflare's Mirage and Polish features:

  • Mirage: Automatically resizes images based on the device a visitor uses.
  • Polish: Strips metadata and compresses images for faster load times.

Accelerate dynamic content with Railgun (Business and Enterprise plans)

Railgun caches dynamic content. Websites running Railgun generally show a 143% improvement in HTML load times and a 90% decrease in Time to First Byte (TTFB) responses.

Use Argo Smart Routing

Easily add Argo to any plan to reduce latency on an average of 33%. Argo’s Tiered Caching and Smart Routing reduce latency by increasing the cache hit ratio for your site. Refer to our guide on enabling Argo as well to our documentation on Argo billing.


Related resources

Open a Cloudflare support ticket

Not finding what you need?

95% of questions can be answered using the search tool. This is the quickest way to get a response.

Powered by Zendesk