If your site appears to be slow, or is experiencing a performance problem, you should look at your web server's overall health, to verify it is operating normally and isn't under any excess load or traffic. In most cases, poor performance is caused by the origin server, so it's a good idea to check with your hosting provider in the first instance.
A useful tool to use to share data with us is a speed test site like webpagetest.org. This tool allows you to test your site speed, and provide a waterfall view of how long each resource (images, CSS, HTML etc) takes to load. This also helps to rule out any local issues (e.g. a poor internet connection) as the source of the problem.
You should run a test with Cloudflare and a test direct to your server as a comparison.
Testing with Cloudflare (Assuming Cloudflare is currently enabled):
- Visit http://webpagetest.org
- Choose a geographic location and a browser that matches as closely as possible to that of your visitors experiencing the slowness
- Enter an example URL and click Start Test. When it is complete save the result URL to share with us.
Testing direct to your origin server:
- Visit http://webpagetest.org
- Enter an example URL
- Choose a the same location and browser as you did above
- Click "Advanced Settings" and then the "Script" tab
- Enter script to send traffic direct to your origin, for example:
setDns www.example.com 220.127.116.11
(You should replace www.example.com with the correct URL and 18.104.22.168 with your origin server IP address).
When both tests are complete, a report will be generated. Here are a few things to check for:
- Compare the performance of the Cloudflare test versus the origin server directly. If the origin server is slower than Cloudflare, you most likely will need to investigate the source of the slowness with your hosting provider.
- If the slowness is on the first request, this typically indicates your server took too long to generate a response. The first request is normally always to your origin server (we don't cache it) and so if this is slow, you will need to speak to your host about this.
If you're still seeing performance problems and your origin server is responding faster than Cloudflare, please send us the following:
- The specific URL(s) you're seeing the problem on.
- Both webpagetest.org URLs for comparison. Please send us the direct links, rather than a screenshot or attachment.
- A traceroute to your domain: How do I run a traceroute?
Advanced users: Ways to tune performance.
Cloudflare’s caching configuration is deliberately quite cautious out of the box. We cache certain static file types only:
If you want to cache static HTML, you can use a “cache everything” page rule:
Note that this isn’t suitable for dynamic content such as login/shopping cart pages etc, since this will cache HTML output from your site- and this will cause problems if you have dynamically-generated content.
Use HTTPS for HTTP/2 support.
HTTP/2 is the latest version of the HTTP protocol, which includes a number of improvements designed to speed up site loading times. This is only supported on HTTPS sites, however, so you would need to use SSL for your site to take advantage of this.
Use page rules instead of redirects at your origin.
You can use our “page rules” functionality for redirects/forwarding on your site. This makes a good alternative to implementing redirects at your server, since it means that our edge will serve the redirects instead- eliminating a connection to your origin and easing your server load.
Railgun for dynamic content acceleration
Railgun is a WAN optimization technology that 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. Railgun is available through a Cloudflare Optimized Partner or with the Cloudflare Business and Enterprise plans.
Argo Smart Routing
Argo, can be easily added to any plan type and reduces latency on average 33% thanks to tiered caching and smart routing. This can help optimize your site and reduce latency for visitors located further away from your origin, by increasing the cache hit ratio for your site and reducing the latency between the visitor and your origin.