Cloudflare's (NET -2.42%) stock price surged 27% on Aug. 5 after the cloud-based services provider posted its second-quarter earnings report. Its revenue rose 54% year over year to $234.5 million, beating analysts' estimates by $7.1 million. Its adjusted net income of $0.3 million marked a major improvement from its net loss of $7.3 million a year earlier, and its break-even earnings per share (EPS) exceeded analysts' expectations by a penny.

Cloudflare's headline numbers looked solid, but its stock remains down more than 40% for the year following its post-earnings rally. Let's review three reasons to buy Cloudflare -- as well as one reason to sell it -- to see if it's finally primed to rebound throughout the rest of the year.

A person uses a tablet computer outside.

Image source: Getty Images.

1. Eight consecutive quarters of 50%-plus revenue growth

Cloudflare's cloud-based content delivery network (CDN) accelerates the delivery of digital content from websites and apps to users. It also secures those connections with bot-blockers and other security tools.

The market's demand for Cloudflare's services skyrocketed over the past several years as companies grappled with the surging usage of streaming media, mobile apps, and cloud-based software. They also needed to fend off more bot-based DDoS (distributed denial-of-service) attacks.

Cloudflare's revenue rose 49% in 2019, 50% in 2020, and 52% to $656.4 million in 2021. Its quarterly revenue has also risen by more than 50% year over year for eight consecutive quarters.

Period

Q2 2021

Q3 2021

Q4 2021

Q1 2022

Q2 2022

Revenue Growth (YOY)

53%

51%

54%

54%

54%

Data source: Cloudflare. YOY = year over year.

Cloudflare expects that impressive streak to finally end with 45% to 46% year-over-year revenue growth in the third quarter. For the full year, it expects its revenue to increase 47% to 48% -- even as macroeconomic headwinds extend its sales cycles and delay its payments from some customers.

Nevertheless, Cloudflare is still generating market-topping growth rates for a cloud-based CDN provider. By comparison, Cloudflare's smaller rival Fastly (FSLY -0.80%) grew its revenue just 22% to $354.3 million in 2021, and it expects just 17% to 20% revenue growth this year.

2. Healthy retention rates

Cloudflare's dollar-based net retention rate, which gauges its year-over-year revenue growth per existing customer, rose above 120% in the first quarter of 2021 and stayed above that level over the past year.

Period

Q2 2021

Q3 2021

Q4 2021

Q1 2022

Q2 2022

Dollar-Based Net Retention

124%

124%

125%

127%

126%

Data source: Cloudflare.

Its dollar-based net retention rate dipped sequentially in the second quarter due to a higher mix of revenues from its larger customers. But during the conference call, CEO Matthew Prince said he still expected the rate to "trend upward over time" and wouldn't "be satisfied until it's above 130%."

3. Its free-cash-flow margin is improving

Cloudflare isn't profitable by generally accepted accounting principles (GAAP) measures yet. However, its non-GAAP gross margin percentages have stayed in the high 70s over the past year, which is consistent with its long-term target of 75% to 77%, and its non-GAAP operating margins have generally hovered near break-even levels as it balanced its growth with new investments.

But like many other high-growth companies, Cloudflare believes its free-cash-flow (FCF) margin paints a clearer picture of its overall financial discipline.

Period

Q2 2021

Q3 2021

Q4 2021

Q1 2022

Q2 2022

Gross Margin

78%

79.2%

79.2%

78.7%

78.9%

Operating Margin

(2.6%)

1.3%

1.2%

2.3%

(0.4%)

FCF Margin

(6%)

(23%)

4.4%

(30.3%)

(2%)

Data source: Cloudflare. Non-GAAP.

Cloudflare's FCF margin improved both sequentially and year over year in the second quarter, and Prince expects it to turn "positive in the second half of the year." It also expects its non-GAAP operating margins to remain positive -- although likely far below 1% -- in the third quarter and for the full year.

The one reason to sell Cloudflare: Its valuation

Cloudflare is a great growth stock, but it's also priced for perfection at 25 times this year's sales. Fastly trades at just four times this year's sales.

Cloudflare's premium price-to-sales ratio doesn't give it much breathing room for mistakes, especially as rising interest rates drive investors away from pricier growth stocks. Its lack of GAAP profits makes it even less attractive in this macroeconomic environment.

Cloudflare's strengths outshine its weaknesses

I believe Cloudflare deserves to trade at a premium because its business is firing on all cylinders. Its near-term returns could be volatile, but the company is maintaining tight long-term strategies, setting realistic goals for itself, and keeping a close eye on its margins. Investors who can tune out the market's near-term noise should still buy Cloudflare's stock today.