/ 24 aug 2025 · writing
How CloudFluently caches 97% of API calls
A CDN-first setup serving 1M+ monthly requests mostly from cache, and how it was built.
Here is how I cache 97% of my 1 Millon+ API calls effectively
Here's the story: CloudFluently now gets ~50k visitors monthly and it got 1M+ API CDN requests and 34.1k+ API requests this August!!
When I checked the metrics, I saw these numbers and thought "wait, that can't be right"🤔
The Math That Blew My Mind:
→ 1M API CDN requests ÷ 34.1k API requests = 29:1 ratio
→ That means 97% of our requests are served from cache!
→ With 50k page views, that's only 0.68 API calls per page view
→ Industry average? 3-5 API calls per page. CloudFluently crushing it.
💻 How I Built a Caching System That Actually Works:
- -Start with CDN-First Architecture
- -Set up a global CDN for all static assets and API responses.
- -This single decision gave us 80% of our cache efficiency before writing any custom code.
- -Layer Your Caching Strategy Intelligently
- -CDN layer: Global assets, images, static API responses
- -Application layer: User sessions, computed progress data
- -Route layer: Page-level caching with smart invalidation
- -Use Conditional Caching Based on User Behavior
- -Cache course content aggressively (rarely changes), but keep user progress real-time.
- -Different data needs different strategies.
- -Monitor Cache Hit Ratios Like Revenue Metrics
- -Track CDN-to-API ratios daily. If it drops below 10:1, investigate immediately.
- -Cache performance = user experience.
- -Strategic Cache Invalidation > Long Expiration
- -Better to invalidate precisely when content updates than guess cache durations. I clear only what actually changed.
👉 The Lesson? Sometimes Don't Over-Engineer!
I was ready to build Redis clusters, implement GraphQL caching, add service workers but a learning platform like CloudFluently isn't computationally expensive.
Redis would add network latency for simple reads, excessive memoization would eat memory for content that barely changes, and service workers would complicate deployment for minimal gains.
Know your application's actual needs before adding complexity.
One Flaw I Found: Some pages make 6-8+ API calls. Even though they're served from cache, a typical page shouldn't exceed 5 API calls, so I'll be working on optimizing this.
I remember working on my website's caching because I'm using high-load animations and components and refused to remove them, but wanted to make the user experience better and faster. Guess it worked really well :)
🙃 Thanks for the support, THE GROWTH IS ABSOLUTELY INSANE and If you want free cloud learning resources, check out -> cloudfluently.com