Cloudflare Dynamic Content Purging: Why Are My Updates Not Live?

Author
Charlotte Miller Author
|
1 week ago Asked
|
15 Views
|
2 Replies
0

I'm tearing my hair out trying to get Cloudflare's dynamic content purging to work for my SaaS. Our users are seeing stale data, and I'm completely stuck!

  • Context: We have a dashboard with frequently updated user data and analytics. When a user makes a change or new data comes in, we need that reflected immediately. We're using Cloudflare for performance, but this cache issue is killing us.
  • Problem: Even after triggering cache purges, users often see old data for several minutes, sometimes longer. It's like the real-time content updates we need just aren't happening reliably.
  • What I've Tried:
    • Using Cloudflare's Purge by URL (single and multiple) via API.
    • Purging Everything via API (as a last resort, which is terrible for performance).
    • Setting Cache-Control: no-cache, must-revalidate on relevant API endpoints (though Cloudflare still seems to cache it).
    • Checked Page Rules โ€“ nothing seems to be overriding the cache control.
    • Verified origin server is sending correct ETag and Last-Modified headers.
  • Example of Failure (Dummy Error Log/Console Output):
    // User A updates their profile.
    // API purge for "/api/user/A/profile" is triggered.
    // User A refreshes browser.
    // Network tab shows:
    // Request URL: https://mysaas.com/api/user/A/profile
    // Status: 200 OK (from Cloudflare cache)
    // CF-Cache-Status: HIT
    // Age: 120 // (Shows 2 minutes old content!)
    // Expected: CF-Cache-Status: DYNAMIC or MISS, Age: 0
  • My Question: What am I missing? Is there a specific header or Cloudflare setting that guarantees immediate cache invalidation for dynamic content?

2 Answers

0
Nala Osei
Answered 3 days ago
To reliably achieve immediate real-time content updates and prevent Cloudflare from caching your dynamic SaaS data, focus on direct cache control:
  • Implement a Cloudflare Page Rule for your dynamic API endpoints (e.g., mysaas.com/api/user/*/profile*) with the setting Cache Level: Bypass. This explicitly instructs Cloudflare not to cache responses for those URLs, ensuring consistent cache invalidation.
Hope this helps your conversions!
0
Charlotte Miller
Answered 3 days ago

Right, Nala Osei, this is honestly the most useful reply I've gotten all week.

Your Answer

You must Log In to post an answer and earn reputation.