Cloudflare (NET 1.44%) and Fastly (FSLY 4.43%) are both cloud-based content delivery network (CDN) providers that accelerate the delivery of digital content for websites. They accomplish that by storing cached copies of the websites on "edge" servers that are located closer to their visitors than the original servers. They also shield those websites from bot-based attacks.

Cloudflare and Fastly both went public in 2019. Cloudflare's stock subsequently rallied more than 550%, but Fastly trades about 10% below its IPO price. Let's see why Cloudflare outperformed Fastly -- and if it's still the better growth stock.

A person uses a laptop, smartphone, and tablet computer which are all tethered to a cloud-based service.

Image source: Getty Images.

Which company is growing faster?

Back in 2019, Cloudflare and Fastly generated $287 million and $201 million in revenue, respectively. But in 2023, Cloudflare generated $1.3 billion in revenue, while Fastly only generated $506 million in revenue. The gap between the two companies widened as Cloudflare grew at a much faster rate than Fastly over the past four years.

Company

2020

2021

2022

2023

Cloudflare Revenue Growth

50%

52%

49%

33%

Fastly Revenue Growth

45%

22%

22%

17%

Data source: Company earnings reports.

Fastly struggled to keep pace with Cloudflare after a severe service outage in 2021 drove away some of its top customers and tarnished its brand. It also went through strategic shifts under three different CEOs since its IPO. Cloudflare didn't suffer any outages on the same scale, and it's been led by the same CEO, its co-founder Matthew Prince, for the past 15 years.

Cloudflare also maintained higher retention rates than Fastly. Cloudflare had a dollar-based net retention rate of 115% at the end of the fourth quarter, while Fastly had a comparable 12-month net retention rate of 113%. Both companies have struggled to grow as the macro headwinds have driven companies to rein in their software spending, but Cloudflare has been more resilient than Fastly. For 2024, Cloudflare expects its revenue to rise 27%, while Fastly anticipates 15%-17% growth.

Which company is more profitable?

Fastly's revenue growth has been stabilizing under its newest CEO Todd Nightingale, but its adjusted gross margins are still much lower than Cloudflare's.

Company

2020

2021

2022

2023

Cloudflare Gross Margin

77.6%

78.6%

78.2%

78.3%

Fastly Gross Margin

60.9%

57.7%

53.6%

56.9%

Data source: Company earnings reports. Non-GAAP basis.

Those lower gross margins suggest that Fastly simply doesn't have much pricing power in the CDN market against Cloudflare. That's worrisome, because Cloudflare has already been profitable on a non-GAAP (generally accepted accounting principles) basis since 2022 -- but Fastly remains unprofitable by the same measure.

For 2024, Cloudflare expects its non-GAAP EPS to rise 18%-20%, while Fastly only anticipates a narrower non-GAAP net loss. On a GAAP basis, analysts expect Cloudflare to narrow its net loss from $178 million to $121 million, but they expect Fastly's net loss to widen from $133 million to $153 million. In other words, the underdog is still racking up steeper losses while generating much lower revenue than the market leader.

Which stock is cheaper relative to its growth rates?

All of those numbers suggest that Fastly is a weaker long-term investment than Cloudflare. But at 20 times this year's sales, Cloudflare looks a lot pricier than Fastly, which trades at just three times this year's sales. Cloudflare's insiders were also net sellers over the past three months, while Fastly's insiders were net buyers.

However, I believe Cloudflare's premium valuation is justified, while Fastly deserves to trade at a discount to its IPO price. Cloudflare is well positioned to grow with the broader CDN market over the next few years, and its profitability should improve significantly as economies of scale kick in. Fastly could struggle to stay relevant as Cloudflare pulls further ahead, so investors should stick with the leader instead of betting on the underdog's recovery.