Cloudflare (NET 1.44%) stock surged more than 20% following the release of its quarterly report for the fourth quarter of 2023 and the entire year. As a result, it sells at its highest price in nearly two years.

Nonetheless, that increase has also taken Cloudflare to its highest valuation since the middle of the 2022 bear market. Now, with generative AI sparking a renewed interest in the stock, its valuation has dramatically increased. Does that mean investors waited too long to buy?

The state of Cloudflare

For anyone who follows cloud stocks, the appeal of Cloudflare is easy to see. It operates more than 300 data centers worldwide, giving it access to over 12,000 internet networks, covering approximately one-third of the world's unique networks. This makes it a leader in edge computing, since having access to nearby data centers tends to reduce latency.

Consequently, the organizations that use Cloudflare's software benefit from a faster and more secure experience online. Additionally, web traffic has risen with the rise of generative AI, making Cloudflare's network more valuable.

Even in what company management described as a "mixed macroeconomic environment" on its Q4 2023 earnings call, the company achieved record annual contract values and beat its previous record for net new customers.

So successful is the company's product that it claimed more than 2,750 large customers as of the end of 2023. That number grew 35% year over year. Moreover, it claims a net revenue retention rate of 115%, meaning the average long-term customer spent 15% more on the platform than they did one year ago.

Why some may hesitate to invest

Unfortunately, Cloudflare's investment case may have become too well known to investors. The company reported $1.3 billion in revenue in 2023, a 33% yearly increase. Still, that also means its price-to-sales (P/S) ratio has risen to about 28.

Admittedly, for a brief period in late 2021, Cloudflare stock sold for more than 100 times sales. Hence, its elevated P/S ratio may not deter investors.

Still, costs and expenses grew nearly as fast as revenue. That left the company with a net loss in 2023 of $184 million, a marginal improvement from the year-ago loss of just over $193 million. Indeed, the loss stems from nearly $288 million in stock-based compensation. Still, such a financial performance indicates generally accepted accounting principles (GAAP) profitability may be years away.

Also, even when measured by the company's 2023 non-GAAP net income, it came in at $170 million, or $0.49 per share. That would imply a P/E ratio of approximately 220. With the company projecting a non-GAAP net income of around $0.59 next year, the valuation does not imply a growth rate that could justify such an earnings multiple.

Hold off on Cloudflare stock

Considering its valuation, investors probably waited too long to buy Cloudflare stock. Indeed, the company offers a compelling product that should become more popular over time. Considering its revenue growth, current shareholders should consider keeping the stock.

Nonetheless, with a P/S ratio of 28 and no end in sight to the GAAP losses, it is quite risky to buy at such levels. To sustain or surpass that valuation, investors may need a bull market similar to 2021, and it is unclear whether the current bull market matches that enthusiasm level.

However, the 2022 bear market compressed this multiple, and it is always possible shifting market sentiment could again make Cloudflare a cheaper stock. Should the P/S ratio fall below 20, investors should reevaluate its investment case.