Cloudflare (NET 0.70%) attracted a lot of attention when it went public on Sept. 13, 2019. The cloud-based content delivery network (CDN) provider listed its shares at $15, and they started trading at $18. In the two years or so that followed, they rallied to an all-time high of $217.25 on Nov. 18, 2021.

But as of this writing, Cloudflare trades at about $58 per share. Therefore, a $1,000 investment in its IPO would have blossomed to just over $12,000 at its peak -- but would only be worth about $3,200 today.

That steep pullback may have been disappointing for those early buy-and-hold shareholders, but a three-bagger gain in just three and a half years isn't too shabby. Let's look back at why Cloudflare's stock initially skyrocketed, why it tumbled, and where it might be headed in the next few years.

Five people hold up a cardboard cutout of a cloud.

Image source: Getty Images.

Why did Cloudflare's stock skyrocket?

A combination of three factors propelled Cloudflare's stock to its all-time high in late 2021.

First, the company initially impressed investors with the growth potential of its content delivery network, which accelerates the delivery of websites' digital content. It accomplishes that by storing cached copies of that content on "edge servers," which are located physically closer to end users than the "origin servers." The company also shields those websites from bot-based attacks. Cloudflare often calls that service a "water filtration system" for the modern internet.

Second, Cloudflare backed up that vision with its dazzling growth rates. Its revenue rose 51% in 2019, 50% in 2020, 52% in 2021, and 49% in 2022. It also became profitable for the first time on a non-GAAP (generally accepted accounting principles) basis in 2022.

In addition, it grew its number of large customers (those who spend more than $100,000 on its services annually) from 580 at the end of 2019 to 2,042 at the end of 2022. For reference, Cloudflare's CDN competitors Fastly and Akamai only grew their revenues by 22% and 4%, respectively, in 2022.

Lastly, the buying frenzy in growth and meme stocks throughout 2021 caused many investors to rush toward the market's highest-growth stocks, regardless of their valuations. At its all-time high, Cloudflare's enterprise value swelled to $69.2 billion -- a whopping 71 times the revenue it actually generated in 2022.

Why did Cloudflare's stock crash?

That frothy valuation wasn't sustainable, and inflation and rising interest rates over the past year quickly popped the bubble, driving investors back toward more conservative investments. Cloudflare now has an enterprise value of $15.5 billion, or 12 times its projected revenue for 2023. It's not cheap yet -- consider that Fastly and Akamai both trade at about 4 times this year's sales -- but it's more reasonably valued than it was in the past.

The other issue for Cloudflare has been its slowing growth. After investors grew accustomed to years of revenue growth in the neighborhood of 50% annually, they weren't too pleased when management forecasted in late April that its revenue would only rise by 31% to 32% in 2023.

To make matters worse, Cloudflare's dollar-based net retention rate, which gauges its year-over-year sales growth among existing customers, slipped from 127% in Q1 2022 to 117% in Q1 2023. Management attributed that slowdown mainly to macroeconomic headwinds, which caused many companies to rein in their spending on cloud-based services, and said it expects that pressure to persist throughout the rest of this year.

Where will Cloudflare's stock head over the next few years?

Cloudflare's growth rates are still impressive, but investors will probably continue to shun its stock as long as interest rates remain elevated and the bear market drags on. But bear markets don't last forever, and this stock could bounce back once a new bull market starts.

For now, analysts expect Cloudflare's revenue to grow at a compound annual rate of 31% between 2022 and 2025. They also expect its free cash flow will turn positive in 2023 and continue rising through 2025. Assuming the stock trades at a reasonable 10 times forward sales by 2025, Cloudflare's enterprise value could reach $22 billion in two years -- which would represent a gain of more than 40% from today.

That outlook might disappoint investors who expected Cloudflare to soar back to its all-time highs, but it seems unlikely that growth stocks will experience another buying frenzy so soon after the sobering reality check the market delivered last year. Nevertheless, Cloudflare is still a promising long-term play for investors who can tune out the near-term noise.