shiichan

Cache Reserve Purge Behavior Changes: Every Purge Is Now a Forced Cache Miss!

Hi everyone, it's Shii-chan!

Cloudflare Changelog developers.cloudflare.com

Today's news is an important behavior change for Cloudflare Cache Reserve. It affects cost, so let's go through it together if you use purge!

What was announced?

The Cloudflare Changelog announced that purge requests now force a cache miss for Cache Reserve content, regardless of purge type. The change applies to purge requests from both the API and the dashboard.

The story so far

Before, the behavior depended on the purge type.

  • Purging by cache tag, hostname, prefix, or everything: matching Cache Reserve content was marked for revalidation
  • Purging by URL: content was removed from Cache Reserve (unchanged by this release)

Now Cache Reserve handles purges the same way as the edge cache.

What changes

After a purge, the next request for the affected content is a Cache Reserve miss. Your origin must deliver the content in full, even if it hasn't changed.

Dive Deep

Here is the cost impact.

  • Your origin has to deliver the content in full
  • Cloudflare then writes it to Cache Reserve again, which is billed as a Class A operation
  • Purging by tag, hostname, prefix, or everything doesn't delete content from Cache Reserve right away, so matching content keeps incurring storage costs until a later request replaces it or its retention period ends

If you frequently purge by these methods, it's worth reviewing the effect on your origin egress and Cache Reserve usage.

To keep content in Cache Reserve and revalidate it as before, send the same request to the new invalidate_cache endpoint.

curl --request POST \
  "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/invalidate_cache" \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{"tags":["product-images"]}'

If your origin returns 304 Not Modified, revalidation helps reduce origin egress.

Wrap-up

  • Purging Cache Reserve content is now a forced cache miss for every purge type
  • After a purge the origin delivers everything, and the re-write is billed as a Class A operation
  • URL purge behavior is unchanged
  • Use invalidate_cache if you want revalidation instead

If you use Cache Reserve and purge by tag or similar, keep an eye on the cost side!