Cloudflare's (NET 0.81%) stock surged 9% during after-hours trading on Feb. 9 after it released its fourth-quarter report. Revenue for the cloud-based software provider rose 42% year over year to $274.7 million, which beat analysts' estimates by $600,000. Its adjusted net income surged from $100,000 to $21.6 million, or $0.06 per share, which topped expectations by a penny.

For the full year, Cloudflare's revenue rose 49% to $975.2 million. It generated an adjusted net profit of $44.4 million, or $0.13 per share, compared to a net loss of $15.1 million, or $0.05 per share, in 2021.

Those headline numbers were impressive, but is it too late to buy Cloudflare's stock after its stunning year-to-date rally of about 40%? Let's review its business model, growth potential, and valuations to decide.

A person uses a tablet computer outside.

Image source: Getty Images.

Why is Cloudflare growing so rapidly?

Cloudflare's content delivery network (CDN) accelerates the delivery of photos, videos, and other digital content for websites. It accomplishes this by storing cached copies of that content on "edge" servers, which are located physically closer to visitors than the "origin" server.

The market's demand for CDN services has skyrocketed in recent years as companies build more media-intensive websites to capitalize on higher internet speeds.

Cloudflare also provides a domain name server (DNS) service that links website addresses to IP addresses, as well as other security tools that shield websites from cyberattacks. If you've ever been asked to prove that you're human while browsing the web, you've likely encountered Cloudflare's defenses -- which it calls a "water filtration" system for the entire internet.

Cloudflare currently serves up data from 285 cities across over 100 countries, and it processes an average of 45 million HTTP requests every second. Approximately a fifth of the entire internet relies on its security services.

Can Cloudflare maintain its momentum?

Between 2019 and 2022, Cloudflare's revenue rose at a compound annual growth rate (CAGR) of 50%. For 2023, it expects its revenue to rise anywhere from 36% to 38%, which exceeds Wall Street's expectations for 34% growth.

Cloudflare's growth is cooling off, but it's still growing faster than many of its peers. For example, its smaller rival Fastly (FSLY 2.09%) is expected to grow its sales by 21% in 2022 and 14% in 2023. Its larger competitor Akamai (AKAM 0.84%) is expected to grow its sales by about 4% in both years.

So Cloudflare seems like a "best in breed" play on the CDN market, which could continue to expand at a CAGR of 23% from 2022 to 2030, according to Grand View Research. It's also a well-rounded play on the global cybersecurity market, which Fortune Business Insights projects will experience a CAGR of 13% from 2022 to 2029.

Can it justify its premium valuation?

Yet investors shouldn't overlook Cloudflare's flaws. Its dollar-based net retention rate, which gauges its year-over-year growth per customer, slipped to 122% in the fourth quarter, compared to 124% in the third quarter and 125% a year earlier.

It pinned that slowdown on its smaller customers, meaning those that spend less than $100,000 on its services annually and are more exposed to macroeconomic headwinds. However, Cloudflare insists it can boost that metric above 130% over the long term.

Cloudflare's adjusted gross margin also fell 40 basis points to 78.2% in 2022. That's still above its long-term target range of 75% to 77%, but that compression reflects its elevated network expenses and macroeconomic challenges.

On the bright side, its adjusted operating margin still improved from negative 1.1% in 2021 to positive 3.7% in 2022 as its scale improved, and CEO Matthew Prince reiterated its goal of generating positive free cash flow (FCF) in 2023 and the "years after that."

Cloudflare's adjusted margins and profits, which exclude the stock-based compensation that consumed 21% of its revenue in 2022, are certainly improving. It expects its adjusted EPS to rise by anywhere from 15% to 23% in 2023.

But on the basis of generally accepted accounting principles (GAAP), which factors in all those costs, Cloudflare is still deeply unprofitable. It also isn't cheap at 15 times this year's sales and over 390 times its forward adjusted earnings. That red ink and high valuation could keep the bulls at bay as long as inflation is running hot and interest rates keep rising.

Is it too late to buy Cloudflare's stock?

Cloudflare is a speculative stock, but it still has room to run. It's growing faster than its rivals, its retention rates suggest it could grow its revenue by at least 20% to 30% annually for several more years, and its improving non-GAAP numbers suggest it could achieve profitability once its reins in its stock-based compensation.

Therefore, it's not too late to buy Cloudflare -- especially if you believe the internet will become much faster, busier, and more dangerous over the next few decades.