A new bull market became official when the S&P 500 (SNPINDEX: ^GSPC) hit a record high in January 2024. Technically, that bull market began when the index reached a bear market low in October 2022. It has since advanced 42%, but history says there is plenty of upside left for patient investors.

The S&P 500 returned an average of 169% during past bull markets, and it realized those returns over an average of 59 months. That leaves implied upside of 127% over the next 43 months.

Of course, that assumes the current bull market aligns precisely with the historical average, which is highly unlikely. But investors should focus on the big picture: Certain stocks could move much higher in the coming years.

With that in mind, Cloudflare (NET 1.44%) is worth buying right now. The company has already proved its ability to create value for shareholders. The stock is up 433% since Cloudflare went public a little less than five years ago. And the company sits at the intersection of two major trends -- artificial intelligence (AI) and cybersecurity -- so investors have good reason to think that outperformance will continue.

Cloudflare operates the fastest cloud network in the world

Cloudflare is a cloud computing company that provides application, network, and security services. Its platform protects and accelerates software and infrastructure across public clouds and private data centers.

The company also offers computing and storage services through its Workers development platform, which empowers businesses to build and run applications.

Cloudflare has advantages in speed and scale. The company operates the fastest cloud network and developer platform on the market. It also handles about 20% of all internet traffic, which creates a network effect. Specifically, with machine learning models trained on vast amounts of internet performance and security data, the company can route traffic and block threats more effectively over time.

Those advantages have consistently led to monster revenue growth. In fact, the company has achieved a compound annual growth rate (CAGR) of 37% since the fourth quarter of 2021, as shown in the chart below.

Chart showing Cloudflare's quarterly revenue between Q4 2021 and Q4 2023.

Cloudflare's quarterly revenue from the 2021 fourth quarter to the same period in 2023 -- a CAGR (compound annual growth rate) of 37% during that period.

Revenue growth has naturally moderated, but Cloudflare still reported excellent results in the fourth quarter. Its customer count increased 17% to nearly 189,800, and the average customer spent 15% more.

In turn, revenue rose 32% to $362 million, and adjusted net income more than doubled to $53 million. Investors have good reason to think that momentum will continue.

Analysts at Morgan Stanley estimate Cloudflare's total addressable market (TAM) at $100 billion by 2026. Two product categories account for nearly three-quarters of that TAM: developer services and network security services. Cloudflare has a strong presence in both markets.

Cloudflare is a leader in edge development platforms

The company is the market leader in edge development platforms, according to Forrester Research. That alone positions it for strong growth, given that the edge computing market is expected to have a compound annual growth rate of 37% through 2030.

But Cloudflare hopes to become the platform of choice for AI inferencing (drawing conclusions from data), a market forecast to grow at 45% annually through 2032.

In September, the company launched Workers AI, an inference-as-a-service solution that lets businesses run AI applications on Nvidia graphics processing units (GPUs) installed across its global network. In other words, Workers AI blends the best AI chips with the fastest developer platform on the market. For that reason, CEO Matthew Prince believes Cloudflare is "uniquely positioned to become a leader in AI inferencing."

The company has also taken a unique approach to pricing R2, a data storage solution that supports Workers AI and competes against S3 from Amazon. Analysts at JPMorgan Chase called attention to its pricing strategy in a recent report: "Cloudflare will avoid charging egress fees or creating other barriers to the movement of data so that it can form the connective layer for AI and other workloads, culminating in a strategy that is distinct and differentiated from hyperscalers and other competitors."

Cloudflare is a leader in zero-trust network security

Beyond developer services and AI, Cloudflare has a strong presence in certain cybersecurity markets. The International Data Corp. recently recognized its leadership in zero-trust network access and network security services, and Forrester Research calls the company a leader in email security.

It's gaining momentum with Cloudflare One, a secure access service edge (SASE) product that protects and connects users with private applications, public cloud services, and the open internet from any device or location. Zscaler is the dominant SASE vendor, but Cloudflare is gaining market share, according to Morgan Stanley.

Shares trade at a tolerable valuation in context

To summarize, Cloudflare has competitive advantages in the speed and scale of its network, such that it has achieved a strong presence in several cloud services verticals. The company has hardly tapped its addressable market, and it has particularly compelling growth opportunities in AI developer services and network security services.

To that end, Wall Street analysts expect sales to grow at 25% annually over the next five years. That consensus estimate makes its current valuation of 24.8 times sales seem tolerable. To be clear, that multiple is nowhere near cheap, so the stock is likely to be quite volatile in the near term. But patient investors with a five-year time horizon should feel comfortable buying a small position today.