We’ve had lots of users ask why we choose StackPath as our CDN provider, instead of a more popular option, Cloudflare.
Well, first off, when we reached out to Cloudflare, they told us they were sun-setting their Optimized Hosting Partner program. There goes that.
In the end though, we chose StackPath because of its developer-friendly platform, as well as the speed benefits it brought, compared to Cloudflare.
PoPs
Cloudflare has over 170+ Points of Presence around to the world, while StackPath only has 45+ PoPs. That said, more PoPs aren’t necessarily good. More PoPs mean that more edge caches have to be primed for a website to achieve the full benefits of a CDN. With StackPath, you’d need at least 45 different requests from different locations for every user to hit a cached copy. With Cloudflare, you’d need over 170 different requests to hit all PoPs.
For low-medium traffic sites, this can actually slow your site down, as Cloudflare purges infrequently accessed pages, meaning more origin pulls are required.
TTFB
Cloudflare argues that Time-To-First-Byte is not as important as others say. Yet, TTFB is one of the most widely used benchmarks of server performance. We used KeyCDN’s performance tool to measure the TTFB of cached pages from various locations.
Cloudflare
StackPath
StackPath consistently beats Cloudflare by 2-3x, except Bangalore, where StackPath doesn’t have PoP but Cloudflare does.
Load Time
Next, we also tested the time it took for each CDN to load an image fully. This one from our previous post, specifically.
We benchmarked this multiple times using Dotcom Tool’s website speed test from all its locations.
Round | StackPath | Cloudflare |
Uncached | 973 ms | 1.1 sec |
Cached 1 | 421 ms | 466 ms |
Cached 2 | 359 ms | 372 ms |
We did multiple rounds of testing cached performance since the numbers were so close, but overall, we found that StackPath almost always beat Cloudflare by 20-60 ms.
We also tested the load time of a full website homepage — our blog — when fully cached at the edge. We used FastOrSlow for this.
Round | SP Full Load | SP TTFB | CF Full Load | CF TTFB |
Uncached | 1.5 sec | 582 ms | 1.6 sec | 604 ms |
Cached 1 | 423 ms | 89 ms | 563 ms | 95 ms |
Cached 2 | 445 ms | 111 ms | 554 ms | 93.6ms |
We see again here that StackPath generally pulls ahead in both fully loaded time and TTFB, albeit by a 30-60 ms usually.
Latency
Another important factor is how much latency each CDN adds. Both are proxy CDNs, which mean all requests go through the respective provider’s network before hitting the origin. This can potentially add extra network hops and cause delays on uncached origin pulls.
To test this, we used Cloudflare PageRules and StackPath EdgeRules to set the cache level of all urls (*) to Bypass and tested our site with FastOrSlow. Origin NGINX cache was enabled and primed for both sites.
Round | SP Full Load | SP TTFB | CF Full Load | CF TTFB |
1 | 1.33 sec | 534 ms | 1.64 sec | 637 ms |
2 | 1.4 sec | 595 ms | 1.68 sec | 652 ms |
3 | 1.36 sec | 565 ms | 1.66 sec | 636 ms |
Here are the raw latencies for the same website without any proxy:
Round | Full Load | TTFB |
1 | 1.4 sec | 454 ms |
2 | 1.37 sec | 452 ms |
3 | 1.36 sec | 453 ms |
We can see that when it comes to latency, StackPath blows Cloudflare out of the water, with a 300ms difference in fully-loaded time, and 100ms difference in TTFB. In fact, StackPath comes pretty close to unproxied latency.
Large Files
Finally, we uploaded a large (17MB) image to our origin server and served it through Cloudflare and StackPath to see which one delivered it faster, when cached.
We ran FastOrSlow 5 times.
Round | SP Full Load | CF Full Load |
1 | 12.64 sec | 14.36 s |
2 | 13.44 sec | 14.28 s |
3 | 11.04 sec | 11.33 s |
4 | 12.24 sec | 12.66 s |
5 | 11.01 sec | 14.74 s |
Average | 12.07 sec | 13.474 |
Here, we see again that StackPath beats Cloudflare by a few seconds when it comes to loading large files also.
Overall, we see StackPath consistently beating Cloudflare by 10-20% when it comes to overall load time, latency, and TTFB.
A few ten or hundred milliseconds may not seem like much, but when it comes to CDNs and last-mile delivery, they matter very much so. We’ve partnered with StackPath to provide a blazing-fast CDN free, with our high performance plans that can accelerate your content delivery by factors of 2-5x. Plus, StackPath’s unlimited EdgeRules allow us to customize each site’s caching behavior to guarantee the best performance.
4 replies on “StackPath vs Cloudflare: Which CDN is Faster?”
It’s not fair comparison
If you really want to compare you should have pikcked from several locations from around the globe
You have missed to add South Africa, Brazil, Middle East and Australia
I’m sure Cloudflare will beat Stackpath easily
Hi,
I understand your concern. However, we did use multiple tools to test the CDNs and we chose those tools because they offered testing from multiple locations.
For example, fastorslow: https://www.fastorslow.com/app/profile/6700adb0-0416-5470-a9f7-d727418ee388
There are South Africa, Australia and Brazil locations in that test.
We also uses Dotcom-Tool’s website test which tested from SA, Brazil, AU, and Middle East.
-John
Problem is that very few people care about Brasil and even fewer about ZAR.
And when it’s time for those regions to start being relevant stackpath will cover them.
Can clodflare solve their problem with company culture and suboptimal development and operation practices ? I would not be so sure.
wrong 🙂 I care about South Africa aka ZAR